aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/snippets.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-02-08 13:37:51 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-02-08 13:37:51 -0500
commit20ae835da5a2fc1f0c2106f85758825d0cfd97e3 (patch)
tree9782c0f817e844b56fd2f9b731335d90aeedc9cd /modules/textadept/snippets.lua
parent33e9c58f408be3c42144b28464a029902580031d (diff)
downloadtextadept-20ae835da5a2fc1f0c2106f85758825d0cfd97e3.tar.gz
textadept-20ae835da5a2fc1f0c2106f85758825d0cfd97e3.zip
Removed buffer:find() function.
Diffstat (limited to 'modules/textadept/snippets.lua')
-rw-r--r--modules/textadept/snippets.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index 8d46610e..d9d40f71 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -251,7 +251,12 @@ next_snippet_item = function()
if s and next_item then
next_item = unescape(next_item)
_DEBUG('next_item:\n'..next_item)
- local s, e = buffer:find(next_item, 0, s_start)
+ local s, e
+ buffer.target_start, buffer.target_end = s_start, buffer.length
+ buffer.search_flags = 0
+ if buffer:search_in_target(next_item) ~= -1 then
+ s, e = buffer.target_start, buffer.target_end
+ end
if s and e then
buffer:set_sel(s, e)
snippet.cursor = s
@@ -283,7 +288,12 @@ next_snippet_item = function()
join_lines()
end
- local s, e = buffer:find('$CURSOR', 4, s_start)
+ local s, e
+ buffer.target_start, buffer.target_end = s_start, buffer.length
+ buffer.search_flags = 4
+ if buffer:search_in_target('$CURSOR') ~= -1 then
+ s, e = buffer.target_start, buffer.target_end
+ end
if s and e then
buffer:set_sel(s, e)
buffer:replace_sel('')