diff options
author | 2010-06-11 19:01:24 -0400 | |
---|---|---|
committer | 2010-06-11 19:01:24 -0400 | |
commit | af7f1ad5ad2bfd7e2935332d385ca05318419dc5 (patch) | |
tree | 5124ba26ac7efd9c85a863cfe245e577ffecd5bc /core/ext/command_entry.lua | |
parent | 8e66381a040f695f4203b28bc3f1d6818d0da7a2 (diff) | |
download | textadept-af7f1ad5ad2bfd7e2935332d385ca05318419dc5.tar.gz textadept-af7f1ad5ad2bfd7e2935332d385ca05318419dc5.zip |
Moved core extension modules into textadept module.
Diffstat (limited to 'core/ext/command_entry.lua')
-rw-r--r-- | core/ext/command_entry.lua | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/core/ext/command_entry.lua b/core/ext/command_entry.lua deleted file mode 100644 index 296244f4..00000000 --- a/core/ext/command_entry.lua +++ /dev/null @@ -1,47 +0,0 @@ --- Copyright 2007-2010 Mitchell mitchell<att>caladbolg.net. See LICENSE. - -local locale = _G.locale - -events.connect('command_entry_command', - function(command) -- execute a Lua command - local f, err = loadstring(command) - if err then error(err) end - gui.command_entry.focus() -- toggle focus to hide - f() - end) - -events.connect('command_entry_keypress', - function(code) - local ce = gui.command_entry - local KEYSYMS = keys.KEYSYMS - if KEYSYMS[code] == 'esc' then - ce.focus() -- toggle focus to hide - return true - elseif KEYSYMS[code] == '\t' then - local substring = ce.entry_text:match('[%w_.:]+$') or '' - local path, o, prefix = substring:match('^([%w_.:]-)([.:]?)([%w_]*)$') - local ret, tbl = pcall(loadstring('return ('..path..')')) - if not ret then tbl = getfenv(0) end - if type(tbl) ~= 'table' then return end - local cmpls = {} - for k in pairs(tbl) do - if type(k) == 'string' and k:find('^'..prefix) then - cmpls[#cmpls + 1] = k - end - end - if path == 'buffer' then - if o == ':' then - for f in pairs(_SCINTILLA.functions) do - if f:find('^'..prefix) then cmpls[#cmpls + 1] = f end - end - else - for p in pairs(_SCINTILLA.properties) do - if p:find('^'..prefix) then cmpls[#cmpls + 1] = p end - end - end - end - table.sort(cmpls) - ce.show_completions(cmpls) - return true - end - end) |