Re: [textadept] interested in scite emulation

From: Robert <ro....at.web.de>
Date: Tue, 7 Dec 2010 09:53:50 +0100

Scott,

On Tue, Dec 7, 2010 at 8:50 AM, Scott Weisman <sweis....at.gmail.com> wrote:
> Hi there. I absolutely LOVE the IDEA of TA. But I have been using
> Scite for many years and quite like much of the behavior and key
> bindings.
>
> Has anyone worked on a Scite emulation for TA or know of anything
> available?
>
> One small example is when you open the find dialog, in Scite, the text
> under the cursor is selected for the find text, and selected so that
> it is easy to enter other text. TA provides no such nice handholding.
> How hard is something like that?

I think there was something like this on the list a while ago.
Adapting key bindings should be no problem, too.

> Also, there is a behavior that drives me crazy in TA and Scite and
> pretty much every other editor I have tried. When you select all (with
> ctrl-a), the cursor is moved (usually to the start of the buffer).
> This drives me crazy, as I then have to use the mouse to click the
> window to get the cursor at least back to the approximate location it
> was before. Is there some way to select all text and have the cursor
> moved back to the original position in the middle of the selection? So
> far in Scite, I have been unable to do so. The text from the beginning
> of the file to the original cursor location is unselected. Maddening!
>

You could try putting this in your init.lua (keys.aa if you're on a Mac):

keys.ca = { function()
  local buffer = buffer
  local KEYSYMS = _m.textadept.keys.KEYSYMS
  local pos = buffer.current_pos
  buffer:select_all()
  local esc = events.connect('keypress', function(code)
    if KEYSYMS[code] == 'esc' then
      buffer:goto_pos(pos)
      events.disconnect('keypress', esc)
    end
  end )
end
}

Pressing Esc should return you to your position. Really helpful - I
often press ctrl-a when I meant to hit ctrl-s...

Robert
Received on Tue 07 Dec 2010 - 03:53:50 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:55:24 EST