Re: [textadept] select all text behavior

From: Robert <ro....at.web.de>
Date: Thu, 9 Dec 2010 10:12:58 +0100

On Thu, Dec 9, 2010 at 9:31 AM, Scott Weisman <sweis....at.gmail.com> wrote:
> 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 }
>

I played around a bit after I posted the above snippet and didn't find
a simple solution.
You can put this event before the other functions connected to the
keypress event by giving the position as an argument.

How about simply having short cuts for
copy everything to clipboard,
delete everything and mabye
cut everything?

Robert
Received on Thu 09 Dec 2010 - 04:12:58 EST

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