[Geany-devel] Geany multicursors patch

Lex Trotman elextr at xxxxx
Sat May 26 00:59:46 UTC 2012


On 26 May 2012 04:50, Colomban Wendling <lists.ban at herbesfolles.org> wrote:
> Le 23/05/2012 21:19, Davide Andreoli a écrit :
>> 2012/5/23 Lex Trotman <elextr at gmail.com>:
>>> [...]
>>>
>>> IMHO the multiselection is now small enough (3 lines)  that a plugin
>>> would be overkill :)
>>>
>>> Davide, what is the impact of enabling this, how do existing features
>>> interact with multiple selections? Do any Geany actions that use
>>> selections fail when fed a multi-selection? How does paste work? And
>>> what if I actually select some text (ie ctrl-swipe not just click).
>>
>> I did not found any regression nor any strangeness or conflict yet.
>> Yes, you can make real multiple selections (Ctrl+Alt+Drag) and the behavior
>> is quite always the expected: 'copy' while multiple selection active will
>> put in the clipboard all the selected text merged, 'paste' instead will only
>> paste at the primary selection, 'typing' with multiple selection will do the
>> same as a single selection (selected text cleared). All other commands
>> should always work normally on the primary selection(the last one done).
>
> After a very small time of testing I see:
>
> *) Replace (^H) "inside selection" doesn't work properly when there are
> multiple selections (the replacement is only done in the last
> selection), while it works fine with rectangular selections.

Agree this one would be expected to work in all selections, and would
be very useful.


> document_replace_sel() should probably be updated then.
>
> BTW, I'm wondering whether Scintilla has two distinct modes for
> rectangular/multiple selections or if a rectangular selection is a
> specialized multiple selection (in which case one single code for
> handling multisel would be enough on our side).
>

"Rectangular selections are handled as multiple selections although
the original rectangular range is remembered so that subsequent
operations may be handled differently for rectangular selections. For
example, pasting a rectangular selection places each piece in a
vertical column." from Scintilla.

Doesn't say how its "remembered" though.

> *) Duplicate line/selection works just fine
>
> *) "Toggle case of the selection" is buggy, it puts the newly-cased text
> altogether on the last selection.  Works fine with rectangular selection.

maybe needs www.scintilla.org/ScintillaDoc.html#SCI_SETMULTIPASTE set

>
> *) Almost all selection-based actions (like "Select current line(s)",
> "toggle line(s) commentation", etc.) only selects the line of the last
> selection
>
>
> IMO Replace and Toggle Case must be updated to work properly.  The other
> selection-based commands that doesn't handle the thing really fine would
> benefit from handling it, but their result isn't as unexpected as the
> two cited above.
>

Just document them to only work on single selection would be ok.

Cheers
Lex


>
> Regards,
> Colomban
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel



More information about the Devel mailing list