From d2d6c40a09f846772d540c4665b39e56fc3c9984 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 9 May 2011 20:16:44 -0400 Subject: Fixed bug in snippets.get_end_position(); modules/textadept/snippets.lua --- modules/textadept/snippets.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/textadept/snippets.lua') 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. -- cgit v1.2.3