Hi all, Had spare time this week end, so I started working on a little project... If some of you use Gedit on Linux, Textmate on Mac, or E texteditor on Win, you may be familiar with the concept of multi-edit.... if not check this video: http://media.jon-walsh.com/content/journal/pages/multi-edit/demo.ogv (made the author of the Multi-edit plugin for gedit)
it's one the feature of gedit that really DO save me some time...very nice for small refractoring...
the closest thing approaching in Geany (and basically all scintilla-based stuff I believe...) is the zero-width rectangular selection... you'll find a patch for editor.c for an embryonic start on this.... the code is awful I reckon...just a draft... the idea behind it is: you click somewhere you want to edit... a subsequent Control+Atl+click somewhere will start a multi edit session... and keep storing these positions... if you add a char, and multi edit is on, it will appear to all positions stored before (this is happening is on_char_added) if you delete, it was a bit more complicated as handling the message SCN_MODIFIED gave weird result....so basically i added a callback on the delete key...that will call on_char_deleted....deleting at all mult edit positions...
a regular click will cancel the multi edit session...
for the moment I only implemented the case where multi edit positions are below the first editing positions (adding and deleting are moving positions around...and it's not easy to keep track of these movements...) there is no indicators showing the other editing positions...(trying to find how to change locally the background of the editor) I need to implement more protections (ex: for exemple, if you change the document with keyboard shortchuts, and dont click anywhere at all, multi edit is not erased, causing pb) would probably nice to implement to start a session without mouse... refine the whole thing to sum up :D....
you can try it out nevertheless and point out what i missed jimmy
On Sun, 10 May 2009 13:58:30 +0200, Jimmy wrote:
Hi all, Had spare time this week end, so I started working on a little project... If some of you use Gedit on Linux, Textmate on Mac, or E texteditor on Win, you may be familiar with the concept of multi-edit.... if not check this video: http://media.jon-walsh.com/content/journal/pages/multi-edit/demo.ogv (made the author of the Multi-edit plugin for gedit)
it's one the feature of gedit that really DO save me some time...very nice for small refractoring...
the closest thing approaching in Geany (and basically all scintilla-based stuff I believe...) is the zero-width rectangular selection... you'll find a patch for editor.c for an embryonic start on this.... the code is awful I reckon...just a draft... the idea behind it is: you click somewhere you want to edit... a subsequent Control+Atl+click somewhere will start a multi edit session... and keep storing these positions... if you add a char, and multi edit is on, it will appear to all positions stored before (this is happening is on_char_added) if you delete, it was a bit more complicated as handling the message SCN_MODIFIED gave weird result....so basically i added a callback on the delete key...that will call on_char_deleted....deleting at all mult edit positions...
a regular click will cancel the multi edit session...
for the moment I only implemented the case where multi edit positions are below the first editing positions (adding and deleting are moving positions around...and it's not easy to keep track of these movements...) there is no indicators showing the other editing positions...(trying to find how to change locally the background of the editor) I need to implement more protections (ex: for exemple, if you change the document with keyboard shortchuts, and dont click anywhere at all, multi edit is not erased, causing pb) would probably nice to implement to start a session without mouse... refine the whole thing to sum up :D....
I don't feel like we really need that where we == I :). Seriously, I didn't even had a look at your code but if possible, it'd be cooler if you would realise this as a plugin. This way you can implement like you want and you are not dependent on the opinion of us picky devs :). Maybe you will run into problems following mouse events for GeanyEditors from a plugin. If so, just tell us, maybe we can extend the plugin API. But as I said, I didn't look at the code at all.
Regards, Enrico
On Mon, 11 May 2009 18:18:33 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
I don't feel like we really need that where we == I :). Seriously, I didn't even had a look at your code but if possible, it'd be cooler if you would realise this as a plugin. This way you can implement like you want and you are not dependent on the opinion of us picky devs :). Maybe you will run into problems following mouse events for GeanyEditors from a plugin. If so, just tell us, maybe we can extend the plugin API. But as I said, I didn't look at the code at all.
I think a plugin is a better place than editor.c also.
I like the idea of it though, but haven't tried the patch.
By chance, there's some related discussion on the scintilla mailing list:
http://groups.google.com/group/scintilla-interest/browse_thread/thread/91c2b...
Regards, Nick
Hi,Given the relatively low enthusiasm, I let that stuff go...and used my own geany customed geany version or gedit... I may look on how to put this into a plugin...
but without modifiying scintilla source code, I've found no way to have multi carets for multi-edit positions.... something they are working on apparently looking at the link you sent me... maybe it's wiser to let this feature pass in scintilla first...
jimmy
2009/5/28 Nick Treleaven nick.treleaven@btinternet.com
On Mon, 11 May 2009 18:18:33 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
I don't feel like we really need that where we == I :). Seriously, I didn't even had a look at your code but if possible, it'd be cooler if you would realise this as a plugin. This way you can implement like you want and you are not dependent on the opinion of us picky devs :). Maybe you will run into problems following mouse events for GeanyEditors from a plugin. If so, just tell us, maybe we can extend the plugin API. But as I said, I didn't look at the code at all.
I think a plugin is a better place than editor.c also.
I like the idea of it though, but haven't tried the patch.
By chance, there's some related discussion on the scintilla mailing list:
http://groups.google.com/group/scintilla-interest/browse_thread/thread/91c2b...
Regards, Nick _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel