diff options
author | 2009-01-08 15:54:26 -0500 | |
---|---|---|
committer | 2009-01-08 15:54:26 -0500 | |
commit | 0194a626fcb17bcb037341fc6c2f586f54d26035 (patch) | |
tree | 9b54a08a6f30ce597b751190c113b934a3bb2b6d /core/ext/key_commands_std.lua | |
parent | 1267b118ffebf604639ca7a56660a1b4b69a2b85 (diff) | |
download | textadept-0194a626fcb17bcb037341fc6c2f586f54d26035.tar.gz textadept-0194a626fcb17bcb037341fc6c2f586f54d26035.zip |
Reformatted all C and Lua code to a single standard for each language.
Diffstat (limited to 'core/ext/key_commands_std.lua')
-rw-r--r-- | core/ext/key_commands_std.lua | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/core/ext/key_commands_std.lua b/core/ext/key_commands_std.lua index 0e52ac98..499305f6 100644 --- a/core/ext/key_commands_std.lua +++ b/core/ext/key_commands_std.lua @@ -27,7 +27,7 @@ keys.clear_sequence = 'esc' local b, v = 'buffer', 'view' local t = textadept -keys.ct = {} -- Textadept command chain +keys.ct = {} -- Textadept command chain -- File keys.cn = { t.new_buffer } @@ -153,12 +153,17 @@ keys.cav = { } -- Project Manager -local function pm_activate(text) t.pm.entry_text = text t.pm.activate() end +local function pm_activate(text) + t.pm.entry_text = text + t.pm.activate() +end keys.csp = { function() if t.pm.width > 0 then t.pm.toggle_visible() end end } -keys.cp = { function() - if t.pm.width == 0 then t.pm.toggle_visible() end - t.pm.focus() -end } +keys.cp = { + function() + if t.pm.width == 0 then t.pm.toggle_visible() end + t.pm.focus() + end +} keys.cap = { c = { pm_activate, 'ctags' }, b = { pm_activate, 'buffers' }, @@ -171,15 +176,19 @@ keys.cap = { -- Recent files. local RECENT_FILES = 1 t.events.add_handler('user_list_selection', - function(type, text) if type == RECENT_FILES then t.io.open(text) end end) -keys.ao = { function() - local buffer = buffer - local list = '' - local sep = buffer.auto_c_separator - buffer.auto_c_separator = ('|'):byte() - for _, filename in ipairs(t.io.recent_files) do - list = filename..'|'..list + function(type, text) + if type == RECENT_FILES then t.io.open(text) end + end) +keys.ao = { + function() + local buffer = buffer + local files = {} + for _, filename in ipairs(t.io.recent_files) do + table.insert(files, 1, filename) + end + local sep = buffer.auto_c_separator + buffer.auto_c_separator = ('|'):byte() + buffer:user_list_show(RECENT_FILES, table.concat(files, '|')) + buffer.auto_c_separator = sep end - buffer:user_list_show( RECENT_FILES, list:sub(1, -2) ) - buffer.auto_c_separator = sep -end } +} |