aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/snippets.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2011-05-09 20:16:44 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2011-05-09 20:16:44 -0400
commitd2d6c40a09f846772d540c4665b39e56fc3c9984 (patch)
tree730db97a0839bcc2d42c08e01efcd4580fda4c85 /modules/textadept/snippets.lua
parent775c84d39f94e603ca81e73d40d993a79513cbca (diff)
downloadtextadept-d2d6c40a09f846772d540c4665b39e56fc3c9984.tar.gz
textadept-d2d6c40a09f846772d540c4665b39e56fc3c9984.zip
Fixed bug in snippets.get_end_position(); modules/textadept/snippets.lua
Diffstat (limited to 'modules/textadept/snippets.lua')
-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.