Re: [Geany-devel] Geany multicursors patch
Hi, Le 22/05/2012 20:40, Davide Andreoli a écrit : 2012/5/21 Dimitar Zhekov dimitar.zhe...@gmail.com mailto:dimitar.zhe...@gmail.com [...] 3. is there a way to really show multiple carets? No easy way AFAIK. hey! you are wrong :P I found the easy way (that also solve the issue 2). I just enabled scintilla multiple selections ! in fact scintilla is able to do exactly what I was searching for :) (thank go to elextr that point me to the right direction in IRC) ...and now the patch is just a 3 liner: +++ b/src/editor.c @@ -4677,6 +4677,11 @@ static ScintillaObject *create_new_sci(GeanyEditor *editor) /* virtual space */ SSM(sci, SCI_SETVIRTUALSPACEOPTIONS, editor_prefs.show_virtual_space, 0); +/* multiple selection */ +SSM(sci, SCI_SETMULTIPLESELECTION, 1, 0); +SSM(sci, SCI_SETADDITIONALSELECTIONTYPING, 1, 0); +SSM(sci, SCI_SETRECTANGULARSELECTIONMODIFIER, SCMOD_SUPER, 0); [...] I was about to dig into the Scintilla doc to check whether that functionality did already exist when I started reading the thread, but I see you and Lex already found out it did :) This is a lot better than the initial implementation and looks like an awesome feature :) [...] note: this is my first geany patch... plese be kind :P Hey, welcome to the dark side of the force^W application then! :) Cheers, Colomban ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] Incompatible UI change, removal of actions from ctrl-click
Hi, Le 24/05/2012 03:27, Lex Trotman a écrit : [posted to both devel and user lists, sorry to those on both] Hi All, Geany currently hard codes two actions to the ctrl-left mouse down input, goto tag if the click is over an identifier or goto matching brace otherwise. This blocks the standard action of add to selection on ctrl-left click and ctrl-left drag. (See Gnome HIG http://developer.gnome.org/hig-book/2.32/hig-book.html#input-mouse 10.1.2) I did a quick check on my system and didn't find any application that did not comply with that guideline, so Geany is the odd one out. Geany has not supported multiple selections so it hasn't been an issue (other than being non-standard and occasionally confusing users), but as there is a proposal to add support for multiple selections to Geany this non-standard behavior is now a problem. As both actions now have a default keybinding (in Git version) I propose that the binding to ctrl-left mouse down simply be removed. Your arguments looks sensible to me, as does the ones from Dimitar in the other thread (that this Ctrl-LMB has too many things bound to it). Of course it'd be better if we had configurable mouse bindings, but that's another story. I also think that if we want to keep a mouse binding for go to tag, we could choose something less common -- Ctrl+Alt, Super, whatever uncommon modifier. Do we want to keep one? Finally, although it's probably obvious, the multi-select feature should have a keybinding. Regards, Colomban PS: funny thing, I just discovered that Mozilla apps did support multi-selection :) ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] Geany multicursors patch
Le 23/05/2012 21:19, Davide Andreoli a écrit : 2012/5/23 Lex Trotman ele...@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. 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). *) 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. *) 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. Regards, Colomban ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] Geany multicursors patch
Le 23/05/2012 21:19, Davide Andreoli a écrit : [...] Ok, I also finished the snippets part, super-easy at the end :) you can find my new 'supersnip' branch at: https://github.com/DaveMDS/geany/tree/supersnip also included the multicursor 3 lines (needed) Here you can read the description, one example and the commit diff for the super snippets patch: https://github.com/DaveMDS/geany/commit/c7035d58f2b8b50df96e9cd9fbf6f9e73ec2ce74 I think also this one is small enough for the core...29 lines :) [...] No review yet but a small test: it looks pretty good, but it has a bug: when no %wordN% is defined but there is a %cursor%, a second selection is created at the very position of the cursor. Cheers, Colomban ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] Geany multicursors patch
On 26 May 2012 04:50, Colomban Wendling lists@herbesfolles.org wrote: Le 23/05/2012 21:19, Davide Andreoli a écrit : 2012/5/23 Lex Trotman ele...@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@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel