aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/lua/commands.lua4
-rw-r--r--modules/textadept/editing.lua2
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/lua/commands.lua b/modules/lua/commands.lua
index 9427e8cc..0b918087 100644
--- a/modules/lua/commands.lua
+++ b/modules/lua/commands.lua
@@ -28,9 +28,9 @@ function try_to_autocomplete_end()
local line_num = buffer:line_from_position(buffer.current_pos)
local line = buffer:get_line(line_num - 1)
for _, patt in ipairs(control_structure_patterns) do
- if line:match(patt) then
+ if line:find(patt) then
local indent = buffer.line_indentation[line_num - 1]
- buffer:add_text(patt:match('repeat') and '\nuntil' or '\nend')
+ buffer:add_text(patt:find('repeat') and '\nuntil' or '\nend')
buffer.line_indentation[line_num + 1] = indent
buffer.line_indentation[line_num] = indent + buffer.indent
buffer:line_up()
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 069135b2..972b52d8 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -136,7 +136,7 @@ function autocomplete_word_from_dict(dict)
if not f then return end
local c_list = {}
for line in f:lines() do
- if line:match('^'..root) then c_list[#c_list + 1] = line end
+ if line:find('^'..root) then c_list[#c_list + 1] = line end
end
f:close()
if #c_list > 0 then buffer:auto_c_show(#root, table.concat(c_list, ' ')) end