diff options
author | 2017-05-26 18:46:48 -0400 | |
---|---|---|
committer | 2017-05-26 18:46:48 -0400 | |
commit | 7ba72017ff94dbb1de41cc7b91cd9cae3ab1e0bb (patch) | |
tree | 0e6c208fffa8c97a18de19b62aa309cc02a89ad3 /modules/textadept/snippets.lua | |
parent | 29ea6c3fb72064775b600fe7b7449f0d20f6ed7d (diff) | |
download | textadept-7ba72017ff94dbb1de41cc7b91cd9cae3ab1e0bb.tar.gz textadept-7ba72017ff94dbb1de41cc7b91cd9cae3ab1e0bb.zip |
Fixed bug that deleted characters outside of mangled snippets.
Diffstat (limited to 'modules/textadept/snippets.lua')
-rw-r--r-- | modules/textadept/snippets.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index d9f30d52..cac83b7b 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -155,7 +155,8 @@ local function new_snippet(text, trigger) index = 0, max_index = 0, snapshots = {}, }, {__index = function(self, k) if k == 'end_pos' then - return buffer:indicator_end(INDIC_SNIPPET, self.start_pos) + local end_pos = buffer:indicator_end(INDIC_SNIPPET, self.start_pos) + return end_pos > self.start_pos and end_pos or self.start_pos elseif k == 'placeholder_pos' then -- Normally the marker is one character behind the placeholder. However -- it will not exist at all if the placeholder is at the beginning of the |