aboutsummaryrefslogtreecommitdiff
path: root/modules/lua/commands.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-01-25 21:09:41 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-01-25 21:09:41 -0500
commit2066415f82ba4fdda8d6f3020024d9fbf997e3da (patch)
tree4d7f591a9d02ac48ad024a2956f8f13ef26f6a1c /modules/lua/commands.lua
parentf0dceb28f133d8392c8947155dc8582ec7737783 (diff)
downloadtextadept-2066415f82ba4fdda8d6f3020024d9fbf997e3da.tar.gz
textadept-2066415f82ba4fdda8d6f3020024d9fbf997e3da.zip
Replaced str:match with str:find where applicable for speed improvements.
Diffstat (limited to 'modules/lua/commands.lua')
-rw-r--r--modules/lua/commands.lua4
1 files changed, 2 insertions, 2 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()