Re: [gedit-list] Auto-closing brackets in selected area



Op vrijdag 05-09-2008 om 00:06 uur [tijdzone -0400], schreef Curtis
Hovey:
> On Thu, 2008-09-04 at 22:41 -0300, Christiano Farina Haesbaert wrote:
> > Hello there, this is my first post to the list, so take it easy :P
> > 
> > I don't know if there is a feature like this in gedit, I've tried to
> > find it in some plugin but failed.
> > 
> > I'll try to explain, suppose I'm there doing some happy coding and I
> > want to select some text, be it 
> > using ctrl + shit + arrow right or even with the mouse, than I want
> > all this selection to be enclosed
> > be it in () or in {}, so I press ( and the selected text becomes
> > enclosed, like this.
> > 
> > 1 - I have the text:
> > This is a very dummy text.
> > 
> > 2 - I select all the text with the mouse
> > 3 - I press (.
> > 4 - The text becomes:
> > (This is a very dummy text.)
> > 
> > Is it possible ? if not I think I will write a plugin to do that.
> 
> It is possible, and would have do be done using a plugin. I believe the
> bracket matching feature in gedit is provided by gtksourceview. You can
> look at that lib's code to see how the matching bracket is found. The
> selection is created from the two textiters that are set to the
> positions of the brackets. (See GtkTextBuffer and GtkTextView).

There is this auto bracket complete plugin, I'm not sure if it also does
this, but if it doesn't, I think it should be included in that plugin.
It might be useful to expose some API in gsv to use its bracket finding
algorithm.

> If you write the plugin in C, it might be prove useful enough to port
> the feature directly to gtksourceview.
> 
> _______________________________________________
> gedit-list mailing list
> gedit-list gnome org
> http://mail.gnome.org/mailman/listinfo/gedit-list
-- 
Jesse van den Kieboom

Personal: http://www.icecrew.nl
Professional: http://www.novowork.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]