[Geany-devel] Multi-Edit for geany...

Enrico Tröger enrico.troeger at xxxxx
Mon May 11 16:18:33 UTC 2009


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

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20090511/e628c666/attachment.pgp>


More information about the Devel mailing list