aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/textadept/lsnippets.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/textadept/lsnippets.lua b/modules/textadept/lsnippets.lua
index bc479011..221ea3a0 100644
--- a/modules/textadept/lsnippets.lua
+++ b/modules/textadept/lsnippets.lua
@@ -228,6 +228,11 @@ function next()
buffer:set_sel(s, s + #next_item)
else -- use the first mirror as a placeholder
s, e = buffer:find('%'..index..'[^(]', 2097152, s_start) -- regexp
+ if not s and not e then
+ -- Scintilla cannot match [\r\n\f] in regexp mode; use '$' instead
+ s, e = buffer:find('%'..index..'$', 2097152, s_start) -- regexp
+ if e then e = e + 1 end
+ end
if not s then snippet.index = index + 1 return next() end
buffer:set_sel(s, e - 1) buffer:replace_sel('')
end