aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/events.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2009-01-25 21:09:41 -0500
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2009-01-25 21:09:41 -0500
commit2066415f82ba4fdda8d6f3020024d9fbf997e3da (patch)
tree4d7f591a9d02ac48ad024a2956f8f13ef26f6a1c /core/events.lua
parentf0dceb28f133d8392c8947155dc8582ec7737783 (diff)
Replaced str:match with str:find where applicable for speed improvements.
Diffstat (limited to 'core/events.lua')
-rw-r--r--core/events.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/events.lua b/core/events.lua
index d7897c6d..9922b438 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -214,7 +214,7 @@ add_handler('view_new',
buffer.property['lexer.lua.home'] = _HOME..'/lexers/'
buffer.property['lexer.lua.script'] = _HOME..'/lexers/lexer.lua'
if _THEME and #_THEME > 0 then
- if not _THEME:match('[/\\]') then
+ if not _THEME:find('[/\\]') then
-- use a lexer theme from Textadept's themes, not scintilla-st's
buffer.property['lexer.lua.color.theme'] =
_HOME..'/themes/'.._THEME..'/lexer.lua'
@@ -240,7 +240,7 @@ add_handler('view_new',
if _THEME and #_THEME > 0 then
local ret, errmsg
- if not _THEME:match('[/\\]') then
+ if not _THEME:find('[/\\]') then
ret, errmsg = pcall(dofile, _HOME..'/themes/'.._THEME..'/view.lua')
else -- _THEME is a folder path
ret, errmsg = pcall(dofile, _THEME..'/view.lua')
@@ -318,7 +318,7 @@ add_handler('buffer_new',
if _THEME and #_THEME > 0 then
local ret, errmsg
- if not _THEME:match('[/\\]') then
+ if not _THEME:find('[/\\]') then
ret, errmsg = pcall(dofile, _HOME..'/themes/'.._THEME..'/buffer.lua')
else -- _THEME is a folder path
ret, errmsg = pcall(dofile, _THEME..'/buffer.lua')
@@ -410,7 +410,7 @@ add_handler('uri_dropped',
function(uris)
local lfs = require 'lfs'
for uri in uris:gmatch('[^\r\n\f]+') do
- if uri:match('^file://') then
+ if uri:find('^file://') then
uri = uri:match('^file://([^\r\n\f]+)')
uri = uri:gsub('%%20', ' ') -- sub back for spaces
if WIN32 then uri = uri:sub(2, -1) end -- ignore leading '/'