From 66dfea2c01a182ff40887142ae4e0675e428aef0 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 23 Dec 2015 20:18:21 -0500 Subject: Attempted fix for edge-case state inconsistency in snippets. --- modules/textadept/snippets.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index 1584dc13..d1adfe58 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -386,7 +386,7 @@ M._snippet_mt = { if buffer:auto_c_active() then buffer:auto_c_complete() end -- Take a snapshot of the current state in order to restore it later if -- necessary. - if self.index > 0 then + if self.index > 0 and self.start_pos < self.end_pos then local text = buffer:text_range(self.start_pos, self.end_pos) local placeholders = {} for pos, ph in self:each_placeholder() do -- cgit v1.2.3