diff options
author | 2018-11-12 12:31:52 -0500 | |
---|---|---|
committer | 2018-11-12 12:31:52 -0500 | |
commit | a0db06b907c8f480226e5758885a0590b29afdc7 (patch) | |
tree | 754bb91fd41bb4f97f83cc0e335e5b4adca7c1bd /modules/textadept/snippets.lua | |
parent | d751e91b06f56fd71ae3b31205aa1673d6012718 (diff) | |
download | textadept-a0db06b907c8f480226e5758885a0590b29afdc7.tar.gz textadept-a0db06b907c8f480226e5758885a0590b29afdc7.zip |
Handle potential mismatch between snippet in buffer and snippet in memory.
Snippet prev/next coupled with subsequent edits may cause the buffer to contain
an unexpected snippet placeholder. Handle it gracefully.
Diffstat (limited to 'modules/textadept/snippets.lua')
-rw-r--r-- | modules/textadept/snippets.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index f7239ef3..c7ff417a 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -551,7 +551,8 @@ M._snippet_mt = { end local id = buffer:indicator_value_at(M.INDIC_PLACEHOLDER, s) local ph = snapshot.placeholders[id] - if (not index or ph.index == index) and (not type or ph[type]) then + if ph and (not index or ph.index == index) and + (not type or ph[type]) then return s, ph end s = buffer:indicator_end(M.INDIC_PLACEHOLDER, i) |