aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/snippets.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2017-05-26 18:46:48 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2017-05-26 18:46:48 -0400
commit7ba72017ff94dbb1de41cc7b91cd9cae3ab1e0bb (patch)
tree0e6c208fffa8c97a18de19b62aa309cc02a89ad3 /modules/textadept/snippets.lua
parent29ea6c3fb72064775b600fe7b7449f0d20f6ed7d (diff)
downloadtextadept-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.lua3
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