Re: mlines and its replacement

From: mitchell <>
Date: Thu, 4 Mar 2010 06:56:48 -0800 (PST)


> 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.

Access to multi-line carets is available for rectangular selection via
keyboard (for editing the same column on multiple lines) and sparse
selection via mouse (for editing [different] columns on different
lines). mlines provided this functionality and is no longer necessary.
I'm really happy with the former, as that was what I used mlines for.
From the talk on scintilla mailing list, there is no way to do the
latter via the keyboard. I think the only way would be a sort of modal
(vi) interface.

> 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
>   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

Fixed. Thanks.


> 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 Thu 04 Mar 2010 - 09:56:48 EST

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