aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-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