Hi all!
http://pastebin.geany.org/jdRsm/
The linked patch implement 'multicursor' mode in editor.c and give the ability to insert text at different positions at the same time, similar to rectangular selections but at random (user selected) places.
It works like this: Ctrl+Alt+Click add a new 'multicursor' at click position, without actually moving the caret, you can add as many as you want. Now you are in multicursors mode, every inserted char is inserted also in all the other positions. To end the mode just move the caret with the arrow keys.
I implemented this in editor.c (and not as an external plugin) because I have plans to also extend the snippets to support multi editing.
Actually the patch is really simple but is just a first test, it is not ready as there are 3 open issue:
1. do you like the feature? :)
2. atm the multimode end when you press up/down/left/right....i don't like it too much, some other idea?
3. is there a way to really show multiple carets? in the patch i'm using the search indicator to highlight the other cursors, but it really should be something like a caret, not an indicator. suggestions welcome
note: this is my first geany patch... plese be kind :P
davemds --- dave@gurumeditation.it - www.gurumeditation.it
On Sun, 20 May 2012 12:30:12 +0200 Davide Andreoli dave@gurumeditation.it wrote:
Hi all!
Hi.
I implemented this in editor.c (and not as an external plugin) because I have plans to also extend the snippets to support multi editing.
Actually the patch is really simple but is just a first test, it is not ready as there are 3 open issue:
- do you like the feature? :)
Yes, but would prefer it as a plugin. Extending it to snippets, well... doesn't seem useful to me.
- atm the multimode end when you press up/down/left/right....i don't like
it too much, some other idea?
Prefferably on the same events that cancel the rectangle multi line character insertion.
- is there a way to really show multiple carets?
No easy way AFAIK.
If you position the cursor on the first of several lines with leading tabs, switch to overwrite and mark the tabs as rectangle, there will be several cursors, each with tab width. So scintilla is actually pretty capable - if you want to get your hands dirty, open it's sources and see how it's done.
note: this is my first geany patch... plese be kind :P
:)
2012/5/21 Dimitar Zhekov dimitar.zhekov@gmail.com
On Sun, 20 May 2012 12:30:12 +0200 Davide Andreoli dave@gurumeditation.it wrote:
Hi all!
Hi.
I implemented this in editor.c (and not as an external plugin) because I have plans to also extend the snippets to support multi editing.
Actually the patch is really simple but is just a first test, it is not ready as there are 3 open issue:
- do you like the feature? :)
Yes, but would prefer it as a plugin. Extending it to snippets, well... doesn't seem useful to me.
Please, give a look at the last mail (the one I replayed) in the geany ml, it seems I'm not the only one searching for snippets that can insert the same typed word in different position inside the snip.
This is my use case: I'm writing some python binding for a library, its a really repetitive task that will end to use this snippet again, again and again:
property XXX: def __get__(self): return self.XXX_get()
def __set__(self, value): self.XXX_set(value)
where XXX is always the same word. so I type "prop+TAB", I got a super usefull spippets expansion, but then I need to write the same word 3 times and this destroy all of the snippet magic :(
- atm the multimode end when you press up/down/left/right....i don't
like
it too much, some other idea?
Prefferably on the same events that cancel the rectangle multi line character insertion.
- 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);
In real they should be just 2 line, the last one is there to solve a scintilla issue (also found in scite): The multiple selection hard-coded binding (Ctrl+Alt) is "shadowed" by the rectangular selection binding (Ctrl). So the only way I found to make multiple selection + rectangular selection to work is to change the binding for the rect selection.
With the patch applied you can make rectangular selection with "Super" and multiple selections with "Ctrl+Alt".
Probably you will not like the binding change (I don't like to change it, I'm quite used to use Ctr for rect selections) so I'm searching another way to solve the binding conflict... suggestions are welcome
NOTE: I switched to github (as requested). Now you can find the new (and the old) patch into 2 branch I have done at: https://github.com/DaveMDS/geany/tree/enable-multiselection ( the new one) https://github.com/DaveMDS/geany/tree/multicursor ( the old one )
feedbacks welcome :) davemds
If you position the cursor on the first of several lines with leading tabs, switch to overwrite and mark the tabs as rectangle, there will be several cursors, each with tab width. So scintilla is actually pretty capable - if you want to get your hands dirty, open it's sources and see how it's done.
note: this is my first geany patch... plese be kind :P
:)
-- E-gards: Jimmy _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On 23 May 2012 04:40, Davide Andreoli dave@gurumeditation.it wrote:
2012/5/21 Dimitar Zhekov dimitar.zhekov@gmail.com
On Sun, 20 May 2012 12:30:12 +0200 Davide Andreoli dave@gurumeditation.it wrote:
Hi all!
Hi.
I implemented this in editor.c (and not as an external plugin) because I have plans to also extend the snippets to support multi editing.
Actually the patch is really simple but is just a first test, it is not ready as there are 3 open issue:
- do you like the feature? :)
Yes, but would prefer it as a plugin. Extending it to snippets, well... doesn't seem useful to me.
Please, give a look at the last mail (the one I replayed) in the geany ml, it seems I'm not the only one searching for snippets that can insert the same typed word in different position inside the snip.
[...]
So Davide, lets see how complex the snippet changes are going to be. If they are small they can probably go in core, otherwise for a function that has an uncommon use-case it should be a plugin as Dimitar suggests.
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).
You *must* update the documentation to match, making sure you catch all places where such a change might impact.
[...]
The multiple selection hard-coded binding (Ctrl+Alt) is "shadowed" by the rectangular selection binding (Ctrl). So the only way I found to make multiple selection + rectangular selection to work is to change the binding for the rect selection.
With the patch applied you can make rectangular selection with "Super" and multiple selections with "Ctrl+Alt".
Probably you will not like the binding change (I don't like to change it, I'm quite used to use Ctr for rect selections) so I'm searching another way to solve the binding conflict... suggestions are welcome
As a GTK app Geany normally tries to follow the Gnome HIG http://developer.gnome.org/hig-book/2.32/hig-book.html#input-mouse section 10.1.2.
This specifies ctrl-click as the extend selection input, and it is in the majority of applications. So despite it having been a Geany setting for a long while, I think it should be changed now that multiple selection is going to be supported.
Any suggestions for a replacement for the go to definition binding?
[...]
Cheers Lex
2012/5/23 Lex Trotman elextr@gmail.com:
On 23 May 2012 04:40, Davide Andreoli dave@gurumeditation.it wrote:
2012/5/21 Dimitar Zhekov dimitar.zhekov@gmail.com
On Sun, 20 May 2012 12:30:12 +0200 Davide Andreoli dave@gurumeditation.it wrote:
Hi all!
Hi.
I implemented this in editor.c (and not as an external plugin) because I have plans to also extend the snippets to support multi editing.
Actually the patch is really simple but is just a first test, it is not ready as there are 3 open issue:
- do you like the feature? :)
Yes, but would prefer it as a plugin. Extending it to snippets, well... doesn't seem useful to me.
Please, give a look at the last mail (the one I replayed) in the geany ml, it seems I'm not the only one searching for snippets that can insert the same typed word in different position inside the snip.
[...]
So Davide, lets see how complex the snippet changes are going to be. If they are small they can probably go in core, otherwise for a function that has an uncommon use-case it should be a plugin as Dimitar suggests.
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/c7035d58f2b8b50df96e9cd9fbf6f9e73ec2...
I think also this one is small enough for the core...29 lines :)
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).
You *must* update the documentation to match, making sure you catch all places where such a change might impact.
sure! doc will be my last commit before the pull request
[...]
The multiple selection hard-coded binding (Ctrl+Alt) is "shadowed" by the rectangular selection binding (Ctrl). So the only way I found to make multiple selection + rectangular selection to work is to change the binding for the rect selection.
With the patch applied you can make rectangular selection with "Super" and multiple selections with "Ctrl+Alt".
Probably you will not like the binding change (I don't like to change it, I'm quite used to use Ctr for rect selections) so I'm searching another way to solve the binding conflict... suggestions are welcome
As a GTK app Geany normally tries to follow the Gnome HIG http://developer.gnome.org/hig-book/2.32/hig-book.html#input-mouse section 10.1.2.
This specifies ctrl-click as the extend selection input, and it is in the majority of applications. So despite it having been a Geany setting for a long while, I think it should be changed now that multiple selection is going to be supported.
Any suggestions for a replacement for the go to definition binding?
this binding issue is driving me crazy!! I don't have a good solution :/ The situation is:
Ctrl+Alt+click(or drag) -> multiple selections (badly hardcoded in scintilla) Ctrl+click -> goto definition
the bind for rectangular selection is strange (at least on my Linux Mint+E17 environment), should be Ctrl+drag, but I can make rect selection only with Ctr+Alt+drag :/ This key can be changed in scintilla with the api: SSM(sci, SCI_SETRECTANGULARSELECTIONMODIFIER, SCMOD_SUPER, 0); SCMOD can be CTRL, ALT or SUPER
the only way I found to make both rectangular and multiple selections, is to set multiple to Super and thus:
Ctrl+Alt+click(or drag) -> multiple selections Ctrl+click -> goto definition Super+drag -> rectangular selection
I don't like to use the Super key, and also smell some possible platform difference around.
btw, thanks for taking the time to follow this issue...and give a try at the 'supersnip' branch, it's amazing! :D
davemds
[...]
Cheers Lex _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
[...]
You *must* update the documentation to match, making sure you catch all places where such a change might impact.
sure! doc will be my last commit before the pull request
Thats what we all say :)
[...]
The multiple selection hard-coded binding (Ctrl+Alt) is "shadowed" by the rectangular selection binding (Ctrl). So the only way I found to make multiple selection + rectangular selection to work is to change the binding for the rect selection.
With the patch applied you can make rectangular selection with "Super" and multiple selections with "Ctrl+Alt".
Probably you will not like the binding change (I don't like to change it, I'm quite used to use Ctr for rect selections) so I'm searching another way to solve the binding conflict... suggestions are welcome
As a GTK app Geany normally tries to follow the Gnome HIG http://developer.gnome.org/hig-book/2.32/hig-book.html#input-mouse section 10.1.2.
This specifies ctrl-click as the extend selection input, and it is in the majority of applications. So despite it having been a Geany setting for a long while, I think it should be changed now that multiple selection is going to be supported.
Any suggestions for a replacement for the go to definition binding?
this binding issue is driving me crazy!! I don't have a good solution :/ The situation is:
Ctrl+Alt+click(or drag) -> multiple selections (badly hardcoded in scintilla)
Also ctrl-shift-click or drag extends the rectangular selection
These roughly match the standard definitions of bounding box select actions and make sense.
Ctrl+click -> goto definition
Which is badly hard coded at src/editor.c:319
Note that it also does "goto matching brace" if the click isn't on an identifier.
This is bad practice as we are now finding. Goto brace has a default keybinding and goto tag can have one. They should not be hard coded to mouse operations. Although this means the user now needs two actions not one, the current usage is non-standard and is blocking the implementation of the standard action. This action should be removed.
the bind for rectangular selection is strange (at least on my Linux Mint+E17 environment), should be Ctrl+drag, but I can make rect selection only
That is because the code mentioned above overrides it, performing the goto action on ctrl+mouse down before it even sees the drag.
[...]> with Ctr+Alt+drag :/
This key can be changed in scintilla with the api: SSM(sci, SCI_SETRECTANGULARSELECTIONMODIFIER, SCMOD_SUPER, 0); SCMOD can be CTRL, ALT or SUPER
the only way I found to make both rectangular and multiple selections, is to set multiple to Super and thus:
Ctrl+Alt+click(or drag) -> multiple selections Ctrl+click -> goto definition Super+drag -> rectangular selection
I don't like to use the Super key, and also smell some possible platform difference around.
As I said above we should change the deviant Geany ctrl+click behavior so the super isn't necessary. I guess this is going to provoke some discussion so I'll start a new thread and maybe you should wait to see the outcome of that.
Cheers Lex
btw, thanks for taking the time to follow this issue...and give a try at the 'supersnip' branch, it's amazing! :D
PS can't try it at the moment, all comments "by inspection".
On Thu, 24 May 2012 10:52:29 +1000 Lex Trotman elextr@gmail.com wrote:
As I said above we should change the deviant Geany ctrl+click behavior so the super isn't necessary.
+1. The current Ctrl+Click goes to definition, or to maching brace, or starts rectangular selection on missing definition, or does nothing on missing matching brace - very annoying.
2012/5/24 Lex Trotman elextr@gmail.com:
[...]
You *must* update the documentation to match, making sure you catch all places where such a change might impact.
sure! doc will be my last commit before the pull request
Thats what we all say :)
[...]
The multiple selection hard-coded binding (Ctrl+Alt) is "shadowed" by the rectangular selection binding (Ctrl). So the only way I found to make multiple selection + rectangular selection to work is to change the binding for the rect selection.
With the patch applied you can make rectangular selection with "Super" and multiple selections with "Ctrl+Alt".
Probably you will not like the binding change (I don't like to change it, I'm quite used to use Ctr for rect selections) so I'm searching another way to solve the binding conflict... suggestions are welcome
As a GTK app Geany normally tries to follow the Gnome HIG http://developer.gnome.org/hig-book/2.32/hig-book.html#input-mouse section 10.1.2.
This specifies ctrl-click as the extend selection input, and it is in the majority of applications. So despite it having been a Geany setting for a long while, I think it should be changed now that multiple selection is going to be supported.
Any suggestions for a replacement for the go to definition binding?
this binding issue is driving me crazy!! I don't have a good solution :/ The situation is:
Ctrl+Alt+click(or drag) -> multiple selections (badly hardcoded in scintilla)
Also ctrl-shift-click or drag extends the rectangular selection
These roughly match the standard definitions of bounding box select actions and make sense.
Ctrl+click -> goto definition
Which is badly hard coded at src/editor.c:319
Note that it also does "goto matching brace" if the click isn't on an identifier.
This is bad practice as we are now finding. Goto brace has a default keybinding and goto tag can have one. They should not be hard coded to mouse operations. Although this means the user now needs two actions not one, the current usage is non-standard and is blocking the implementation of the standard action. This action should be removed.
the bind for rectangular selection is strange (at least on my Linux Mint+E17 environment), should be Ctrl+drag, but I can make rect selection only
That is because the code mentioned above overrides it, performing the goto action on ctrl+mouse down before it even sees the drag.
[...]> with Ctr+Alt+drag :/
This key can be changed in scintilla with the api: SSM(sci, SCI_SETRECTANGULARSELECTIONMODIFIER, SCMOD_SUPER, 0); SCMOD can be CTRL, ALT or SUPER
the only way I found to make both rectangular and multiple selections, is to set multiple to Super and thus:
Ctrl+Alt+click(or drag) -> multiple selections Ctrl+click -> goto definition Super+drag -> rectangular selection
I don't like to use the Super key, and also smell some possible platform difference around.
As I said above we should change the deviant Geany ctrl+click behavior so the super isn't necessary. I guess this is going to provoke some discussion so I'll start a new thread and maybe you should wait to see the outcome of that.
indeed, I will wait for the new thread to end.
thanks davemds
Cheers Lex
btw, thanks for taking the time to follow this issue...and give a try at the 'supersnip' branch, it's amazing! :D
PS can't try it at the moment, all comments "by inspection". _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Le 23/05/2012 21:19, Davide Andreoli a écrit :
2012/5/23 Lex Trotman elextr@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
On 26 May 2012 04:50, Colomban Wendling lists.ban@herbesfolles.org wrote:
Le 23/05/2012 21:19, Davide Andreoli a écrit :
2012/5/23 Lex Trotman elextr@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
2012/5/26 Lex Trotman elextr@gmail.com:
On 26 May 2012 04:50, Colomban Wendling lists.ban@herbesfolles.org wrote:
Le 23/05/2012 21:19, Davide Andreoli a écrit :
2012/5/23 Lex Trotman elextr@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.
Yes, exactly, thanks for pointing the right direction! I reimplemented that function to work with multiple selections commit: https://github.com/DaveMDS/geany/commit/286b26a08f9bb059677b5c743efe5ecb26b9...
It works flawlessy in my test, but this is sensitive area, please test well !
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
Where is the "Toggle case of the selection" I can't find it :/ it's is some plugin ?
btw I added the SETMULTIPASTE command with the commit: https://github.com/DaveMDS/geany/commit/d64ea851afc60dc7729eff033a0053234018...
So that now "paste" will work at each selections, not just the 'primary'. like rectangular do.
*) 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
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/c7035d58f2b8b50df96e9cd9fbf6f9e73ec2...
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
2012/5/25 Colomban Wendling lists.ban@herbesfolles.org:
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/c7035d58f2b8b50df96e9cd9fbf6f9e73ec2...
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.
:O ok, I broke all the "normal" snippet...incredible I did'n noticed... fixed with commit: https://github.com/DaveMDS/geany/commit/d12c85496c64be23a9e6b2d225ff3fc818c8...
Thanks for the report! davemds
Cheers, Colomban _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Davide,
Replied on this thread rather than pollute the one discussing UI change.
see edit->format->toggle case of selection
callbacks.c:715
Cheers Lex
2012/5/29 Lex Trotman elextr@gmail.com:
Davide,
Replied on this thread rather than pollute the one discussing UI change.
see edit->format->toggle case of selection
callbacks.c:715
ok, found, was easy, but the italian translation i'm using was confusing me ;)
I made the command works with multiple selection too, commit: https://github.com/DaveMDS/geany/commit/0f8f3d201b7c2c6f3c2712509e805aa23ddd...
also fixed the placement of the cursor after the command when nothing is selected.
bug -1 feature +1 additions +10 deletion -37 ... a totally win commit :D
davemds
Cheers Lex _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Hi,
Le 22/05/2012 20:40, Davide Andreoli a écrit :
2012/5/21 Dimitar Zhekov <dimitar.zhekov@gmail.com mailto:dimitar.zhekov@gmail.com>
[...]
- 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