From 7ba72017ff94dbb1de41cc7b91cd9cae3ab1e0bb Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Fri, 26 May 2017 18:46:48 -0400 Subject: Fixed bug that deleted characters outside of mangled snippets. --- modules/textadept/snippets.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') 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 -- cgit v1.2.3