aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/snippets.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index 3fff2de2..988424b6 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -263,7 +263,9 @@ _snippet_mt = {
-- Gets a snippet's end position in the Scintilla buffer.
-- @param snippet The snippet returned by new_snippet().
get_end_position = function(snippet)
- return buffer:indicator_end(INDIC_SNIPPET, snippet.start_position + 1)
+ local e = buffer:indicator_end(INDIC_SNIPPET, snippet.start_position + 1)
+ if e == 0 then e = snippet.start_position end
+ return e
end,
-- Gets the text for a snippet.