[Geany-devel] Per document tab width

Eugene Arshinov earshinov at xxxxx
Wed Jul 21 05:08:26 UTC 2010


On Tue, 20 Jul 2010 22:20:52 +0200%
Jiří Techet <techet at gmail.com> wrote:

> Hi,
> 
> I have one more feature idea and would like to ask if it is something
> that others would like to see too before I start implementing it. I'm
> working on a project where everyone expresses his personality by using
> different tab width for indenting - I have already seen sources with
> tab size of 2, 3, 4, 5, 6 and 8 (it's just a matter of time until I
> see a source with tab width 7). Of course, these people (or people who
> were editing the same source afterwards) also use spaces so sometimes
> it happens that I have e.g. tab size set to 4 but the other file I
> edit has tab size 2 and it uses spaces too, so what I see is that the
> lines using tab get indented less than the lines using spaces. I
> usually ignore it, but sometimes the code is so unreadable that I have
> to change the tab size. And this is the problem - with geany you have
> to do it either per project or globally, it's not possible for a
> single file. So I have to switch it in the project settings, look at
> the file, and switch it back again because I return back to a file
> with different indent size.
> 
> I would propose to have one more entry in the Document menu called
> e.g. "Tab size" and placed under "Indent type" with a submenu
> containing numbers from 2 to 8 (I hope there is nobody so crazy that
> he would use tab for a single char indent or go over 8 characters)
> with a radio button selecting the active selection. The user could
> change the default tab size of the active document to anything he
> wishes.

I think it may be useful, though I've never really needed it.

> This settings could also be saved into the project/session
> file so the files get reloaded with the same tab size settings. What
> do you think about this feature?
> 

For me, a better way would be to support Emacs/Vi mode lines. I know
Gedit has a plugin for that, maybe this functionality can be borrowed
from there. Mode lines will be also useful for specifying document
encoding so that user don't have to choose it manually each time it
opens the file (I sometimes have to work with files in cp1251,
traditional codepage for Russian Windows…).

Best regards,
Eugene.



More information about the Devel mailing list