aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2015-12-23 20:18:21 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2015-12-23 20:18:21 -0500
commit66dfea2c01a182ff40887142ae4e0675e428aef0 (patch)
tree1d268a924c5067fd9bc49c4471ecbc95518b107e /modules
parent9e4e226aab06ed48025cb3e655a47b348416ea81 (diff)
downloadtextadept-66dfea2c01a182ff40887142ae4e0675e428aef0.tar.gz
textadept-66dfea2c01a182ff40887142ae4e0675e428aef0.zip
Attempted fix for edge-case state inconsistency in snippets.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/snippets.lua2
1 files changed, 1 insertions, 1 deletions
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