Re: [code] [textadept] How would I add a keybinding for use in CDK field?

From: Mitchell <m.att.foicica.com>
Date: Mon, 15 Apr 2013 10:08:59 -0400 (Eastern Daylight Time)

Pete,

On Sun, 14 Apr 2013, Peter Kazmier wrote:

> Where are the CDK bindings defined? I see some of them, but not all of
> them. I'm specifically trying to add support for Ctl-W which is fairly
> universal to mean delete back one word. The file dialog boxes are
> killing my speed for two reasons: 1) I can't delete back a word at a
> time, and 2) tab completion doesn't add the trailing '/' for a directory
> unless you press tab twice.

Keys are generally in bindings.c, entry.c, and fselect.c. I will commit a
fix that allows you to set `gui.command_entry.entry_text` while the curses
command entry is open so you can implement your "delete back word" in pure
Lua, e.g.:

    keys.lua_command = {
      ...
      ['cw'] = function()
        local gui_ce = gui.command_entry
        gui_ce.entry_text = gui_ce.entry_text:match('^(.-)[%w_]+$')
      end
    }

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 15 Apr 2013 - 10:08:59 EDT

This archive was generated by hypermail 2.2.0 : Tue 16 Apr 2013 - 06:45:56 EDT