aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/find.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-08-24 14:26:24 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-08-24 14:26:24 -0400
commit2052c77111051972d8171d27c8d4c501803e70d6 (patch)
treea38f24f35a3a4dc06f32eb365f439fc2b3918ea7 /modules/textadept/find.lua
parent58e1d2b46d09b79ad9c43ae177057c8578294649 (diff)
downloadtextadept-2052c77111051972d8171d27c8d4c501803e70d6.tar.gz
textadept-2052c77111051972d8171d27c8d4c501803e70d6.zip
Include Scintilla constants in `buffer`s.
Diffstat (limited to 'modules/textadept/find.lua')
-rw-r--r--modules/textadept/find.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index 50b557ba..cb0bd449 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -115,10 +115,9 @@ local escapes = {
local function find_(text, next, flags, no_wrap, wrapped)
if text == '' then return end
if not flags then
- local c = _SCINTILLA.constants
flags = 0
- if M.match_case then flags = flags + c.SCFIND_MATCHCASE end
- if M.whole_word then flags = flags + c.SCFIND_WHOLEWORD end
+ if M.match_case then flags = flags + buffer.SCFIND_MATCHCASE end
+ if M.whole_word then flags = flags + buffer.SCFIND_WHOLEWORD end
if M.lua then flags = flags + 8 end
if M.in_files then flags = flags + 16 end
end
@@ -183,7 +182,7 @@ local function find_incremental(text, next, anchor)
M.incremental_start = buffer.current_pos + (next and 1 or -1)
end
buffer:goto_pos(M.incremental_start or 0)
- find_(text, next, M.match_case and _SCINTILLA.constants.SCFIND_MATCHCASE or 0)
+ find_(text, next, M.match_case and buffer.SCFIND_MATCHCASE or 0)
end
---
@@ -360,11 +359,11 @@ function M.goto_file_found(line, next)
if next then buffer:line_end() else buffer:home() end
buffer:search_anchor()
local f = buffer['search_'..(next and 'next' or 'prev')]
- local pos = f(buffer, _SCINTILLA.constants.SCFIND_REGEXP, '^.+:[0-9]+:.+$')
+ local pos = f(buffer, buffer.SCFIND_REGEXP, '^.+:[0-9]+:.+$')
if pos == -1 then
buffer:goto_line(next and 0 or buffer.line_count)
buffer:search_anchor()
- pos = f(buffer, _SCINTILLA.constants.SCFIND_REGEXP, '^.+:[0-9]+:.+$')
+ pos = f(buffer, buffer.SCFIND_REGEXP, '^.+:[0-9]+:.+$')
end
if pos == -1 then if CURSES then view:goto_buffer(cur_buf) end return end
line = buffer:line_from_position(pos)