Re: [gedit-list] Tabulation per file type



On mar, 2007-01-02 at 13:11 -0200, Nando Vieira wrote:
> Hi.
> 
> I'm creating a gedit plugin. I want to define tabulation based on file type.
> 
> * html = 1 tab
> * css = 1 tab
> * python = 4 spaces
> * ruby = 2 spaces
> 
> ....
> 
> My doubt is: how can I intercept tab adding event?
> 

You shouldn't intercept the event: you need to set the tab-width and the
insert-spaces-instead-of-tabs properties of GtkSourceView depending on
the mime type.

As Trond said, the modelines plugin does something similar, but it
parses the modeline instead of deciding depending on the mime type.

ciao
	Paolo





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