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_mac.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_mac.lua')
-rw-r--r-- | core/ext/key_commands_mac.lua | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/core/ext/key_commands_mac.lua b/core/ext/key_commands_mac.lua index d4e0ed31..11378804 100644 --- a/core/ext/key_commands_mac.lua +++ b/core/ext/key_commands_mac.lua @@ -153,12 +153,17 @@ keys.cv = { } -- 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.sap = { function() if t.pm.width > 0 then t.pm.toggle_visible() end end } -keys.ap = { function() - if t.pm.width == 0 then t.pm.toggle_visible() end - t.pm.focus() -end } +keys.ap = { + 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,18 +176,22 @@ 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.co = { 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.co = { + 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 } +} -- Movement/selection commands keys.cf = { 'char_right', b } |