From 35e35e5e6b77e895a78eef96982eea808e202aba Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 2 Nov 2008 21:44:53 -0500 Subject: Fixed key handling and arg handling for Mac. --- core/ext/keys.lua | 6 +++--- init.lua | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/ext/keys.lua b/core/ext/keys.lua index 22ec2def..00d5804f 100644 --- a/core/ext/keys.lua +++ b/core/ext/keys.lua @@ -124,9 +124,6 @@ local function keypress(code, shift, control, alt) local buffer, textadept = buffer, textadept local string, pcall = string, pcall local keys = _G.keys - control = control and CTRL or '' - shift = shift and SHIFT or '' - alt = alt and ALT or '' local key --print(code, string.char(code)) if code < 256 then @@ -144,6 +141,9 @@ local function keypress(code, shift, control, alt) if not KEYSYMS[code] then return end key = KEYSYMS[code] end + control = control and CTRL or '' + shift = shift and SHIFT or '' + alt = alt and ALT or '' local key_seq = string.format('%s%s%s%s', control, shift, alt, key) if #keychain > 0 and key_seq == keys.clear_sequence then diff --git a/init.lua b/init.lua index bce765c8..bd25ee33 100644 --- a/init.lua +++ b/init.lua @@ -20,18 +20,19 @@ require 'ext/key_commands' if not RESETTING then -- process command line arguments local textadept = textadept + if MAC and arg[1] and arg[1]:match('^%-psn_0') then + table.remove(arg, 1) + end if #arg == 0 then textadept.io.load_session() else local base_dir = arg[0]:match('^.+/') or '' local filepath for _, filename in ipairs(arg) do - if not MAC or not filename:match('^%-psn_0') then - if not filename:match('^~?/') then - textadept.io.open(base_dir..filename) - else - textadept.io.open(filename) - end + if not filename:match('^~?/') then + textadept.io.open(base_dir..filename) + else + textadept.io.open(filename) end end -- read only the Project Manager session settings -- cgit v1.2.3