select all text behavior

From: Scott Weisman <sweis....at.gmail.com>
Date: Thu, 9 Dec 2010 00:31:10 -0800 (PST)

I'm interested in further tweaking this. Robert gave a binding for
keys.ca that reverted on esc. But I would like to change this to
revert to the old cursor pos on ANY keypress, and then pass that
keypress through for further processing. Is this possible?

Something like:

keys.ca = { function ()
    local buffer = buffer
    local KEYSYMS = _m.textadept.keys.KEYSYMS
    local pos = buffer.current_pos
    buffer:select_all()
    local restore = events.connect('keypress', function(code)
            buffer:goto_pos(pos)
            events.disconnect('keypress', restore)
            *** pass code here to the next or default keypress event
handler
        end
    end)
end }
Received on Thu 09 Dec 2010 - 03:31:10 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:56:17 EST