<div class="gmail_quote">2012/5/21 Dimitar Zhekov <span dir="ltr"><<a href="mailto:dimitar.zhekov@gmail.com" target="_blank">dimitar.zhekov@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Sun, 20 May 2012 12:30:12 +0200<br>
Davide Andreoli <<a href="mailto:dave@gurumeditation.it">dave@gurumeditation.it</a>> wrote:<br>
<br>
> Hi all!<br>
<br>
Hi.<br>
<div class="im"><br>
> I implemented this in editor.c (and not as an external plugin) because I<br>
> have plans to also extend the snippets to support multi editing.<br>
><br>
> Actually the patch is really simple but is just a first test, it is not<br>
> ready as there are 3 open issue:<br>
><br>
> 1. do you like the feature? :)<br>
<br>
</div>Yes, but would prefer it as a plugin. Extending it to snippets, well...<br>
doesn't seem useful to me.<br></blockquote><div><br>Please, give a look at the last mail (the one I replayed) in the geany ml,<br>it seems I'm not the only one searching for snippets that can insert the<br>same typed word in different position inside the snip.<br>

<br>This is my use case:<br>I'm writing some python binding for a library, its a really repetitive task that<br>will end to use this snippet again, again and again:<br><br>property XXX:<br>        def __get__(self):<br>

                return self.XXX_get()<br><br>        def __set__(self, value):<br>                self.XXX_set(value)<br><br>where XXX is always the same word. so I type "prop+TAB", I got a super usefull<br>spippets expansion, but then I need to write the same word 3 times and this destroy<br>

all of the snippet magic :(<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
> 2. atm the multimode end when you press up/down/left/right....i don't like<br>
> it too much, some other idea?<br>
<br>
</div>Prefferably on the same events that cancel the rectangle multi line<br>
character insertion.<br>
<div class="im"><br>
> 3. is there a way to really show multiple carets?<br>
<br>
</div>No easy way AFAIK.<br></blockquote><div><br>hey! you are wrong :P<br><br>I found the easy way (that also solve the issue 2). I just enabled scintilla <br>multiple selections ! in fact scintilla is able to do exactly what I was<br>

searching for :)<br>(thank go to elextr that point me to the right direction in IRC)<br><br>...and now the patch is just a 3 liner:<br><br>+++ b/src/editor.c<br>@@ -4677,6 +4677,11 @@ static ScintillaObject *create_new_sci(GeanyEditor *editor)<br>

     /* virtual space */<br>     SSM(sci, SCI_SETVIRTUALSPACEOPTIONS, editor_prefs.show_virtual_space, 0);<br><br>+    /* multiple selection */<br>+    SSM(sci, SCI_SETMULTIPLESELECTION, 1, 0);<br>+    SSM(sci, SCI_SETADDITIONALSELECTIONTYPING, 1, 0);<br>

+    SSM(sci, SCI_SETRECTANGULARSELECTIONMODIFIER, SCMOD_SUPER, 0);<br><br><br>In real they should be just 2 line, the last one is there to solve a scintilla issue (also found in scite):<br>The multiple selection hard-coded binding (Ctrl+Alt) is "shadowed" by the rectangular selection<br>

binding (Ctrl). So the only way I found to make multiple selection + rectangular selection to work <br>is to change the binding for the rect selection.<br><br>With the patch applied you can make rectangular selection with "Super" and multiple selections with "Ctrl+Alt".<br>

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

<br><br>NOTE: I switched to github (as requested). Now you can find the new (and the old) patch <br>into 2 branch I have done at:<br><a href="https://github.com/DaveMDS/geany/tree/enable-multiselection">https://github.com/DaveMDS/geany/tree/enable-multiselection</a> ( the new one)<br>

<a href="https://github.com/DaveMDS/geany/tree/multicursor">https://github.com/DaveMDS/geany/tree/multicursor</a> ( the old one )<br><br><br>feedbacks welcome :)<br>davemds<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<br>
If you position the cursor on the first of several lines with leading<br>
tabs, switch to overwrite and mark the tabs as rectangle, there will be<br>
several cursors, each with tab width. So scintilla is actually pretty<br>
capable - if you want to get your hands dirty, open it's sources and<br>
see how it's done.<br>
<div class="im"><br>
> note: this is my first geany patch... plese be kind :P<br>
<br>
</div>:)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
E-gards: Jimmy<br>
_______________________________________________<br>
Geany-devel mailing list<br>
<a href="mailto:Geany-devel@uvena.de">Geany-devel@uvena.de</a><br>
<a href="https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel" target="_blank">https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel</a><br>
</font></span></blockquote></div><br>