From 29a56dc530cebfaa0bdbfadd414588704e0fc374 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 18 Sep 2012 15:49:32 -0400 Subject: Fixed incremental find in ncurses. --- modules/textadept/command_entry.lua | 1 - modules/textadept/find.lua | 17 +++++++---------- modules/textadept/keys.lua | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) (limited to 'modules/textadept') diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua index 262444d6..c1673217 100644 --- a/modules/textadept/command_entry.lua +++ b/modules/textadept/command_entry.lua @@ -43,7 +43,6 @@ end) events.connect(events.COMMAND_ENTRY_KEYPRESS, function(code) if keys.KEYSYMS[code] == 'esc' then gui.command_entry.focus() -- toggle focus to hide - return true elseif not NCURSES and keys.KEYSYMS[code] == '\t' or code == 9 then local substring = gui.command_entry.entry_text:match('[%w_.:]+$') or '' local path, o, prefix = substring:match('^([%w_.:]-)([.:]?)([%w_]*)$') diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 279a7adb..20dba7c4 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -233,16 +233,13 @@ function find.find_incremental() end events_connect(events.COMMAND_ENTRY_KEYPRESS, function(code) - if find.incremental then - if keys.KEYSYMS[code] == 'esc' then - find.incremental = nil - elseif code < 256 or keys.KEYSYMS[code] == '\b' then - if keys.KEYSYMS[code] == '\b' then - find_incremental(gui.command_entry.entry_text:sub(1, -2)) - else - find_incremental(gui.command_entry.entry_text..string.char(code)) - end - end + if not find.incremental then return end + if not NCURSES and keys.KEYSYMS[code] == 'esc' or code == 27 then + find.incremental = nil + elseif keys.KEYSYMS[code] == '\b' then + find_incremental(gui.command_entry.entry_text:sub(1, -2)) + elseif code < 256 then + find_incremental(gui.command_entry.entry_text..string.char(code)) end end, 1) -- place before command_entry.lua's handler (if necessary) diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua index c7a2aa0c..a4a23406 100644 --- a/modules/textadept/keys.lua +++ b/modules/textadept/keys.lua @@ -180,7 +180,7 @@ local M = {} -- Bksp |⌫
⇧⌫ |^H
Bksp |Delete back -- Ctrl+Bksp |⌘⌫ |None |Delete word left -- Ctrl+Shift+Bksp |⌘⇧⌫ |None |Delete line left --- Tab |⇥ |Tab |Insert tab or indent +-- Tab |⇥ |Tab
^I |Insert tab or indent -- Shift+Tab |⇧⇥ |S-Tab |Dedent -- None |^K |^K |Cut to line end -- None |^L |None |Center line vertically -- cgit v1.2.3