diff options
author | 2008-09-27 16:27:11 -0400 | |
---|---|---|
committer | 2008-09-27 16:27:11 -0400 | |
commit | 266058b017447d5c40bb3cff9d61bc5b8c0ad97d (patch) | |
tree | 7798c777c2dc3239583c3403a1aa60565cde083c /modules/textadept | |
parent | e95e51cb99a947865644628d1a3b116ad69b9a01 (diff) | |
download | textadept-266058b017447d5c40bb3cff9d61bc5b8c0ad97d.tar.gz textadept-266058b017447d5c40bb3cff9d61bc5b8c0ad97d.zip |
Fixed modules/textadept/lsnippets.lua bug for placeholders.
If placeholders occured just before an EOL, Scintilla regex matching cannot
recognize newline characters as [^(]. Had to explicitly search for the case
where an EOL occurs after the placeholder being searched for.
Diffstat (limited to 'modules/textadept')
-rw-r--r-- | modules/textadept/lsnippets.lua | 5 |
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 |