mlines and its replacement

From: Brian Schott <briancsch....at.gmail.com>
Date: Wed, 03 Mar 2010 20:48:15 -0800

I noticed from the Mercurial commits that the mlines module has been
removed. Are there plans to write a replacement module that allows
access to the multi-caret capabilities? I have been working on one
myself and am planning on releasing it on Friday (assuming I don't find
bugs between now and then). Its main feature is working around all the
ways that Scintilla tries to get rid of carets other than the main one.

On the subject of multi-editing, I think that some of the functions in
editing.lua need to be tweaked a bit to be multi-caret aware. The
biggest problem I've run into is the auto-closing of "({[ and so on
canceling all carets except the main one. Modifying the function so that
it only works when there is one caret is the best solution I could find.
(storing and then restoring the multi-carets is not a trivial thing to
do when the buffer is modified.)

if AUTOPAIR then
textadept.events.add_handler('char_added',
  function(c) -- matches characters specified in char_matches
    if char_matches[c] then
      if buffer.selections == 1 then
        buffer:insert_text(buffer.current_pos, char_matches[c])
      end
    end
  end)
end

These issues aside, the multi-caret thing is magic. It makes my XML
module's auto-closing of tags so much nicer. (That's on its way also,
but it still has some issues for me to clear up. I'm not
promising/suggesting a release date on that yet)

- Brian
Received on Wed 03 Mar 2010 - 23:48:15 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:39:38 EST