[Geany-devel] Per document tab width
techet at xxxxx
Thu Jul 22 21:54:53 UTC 2010
On Thu, Jul 22, 2010 at 20:05, Dimitar Zhekov <dimitar.zhekov at gmail.com> wrote:
> On Tue, 20 Jul 2010 22:20:52 +0200
> Jiří Techet <techet at gmail.com> wrote:
>> 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).
> I have the same problem sometimes, with my company sources, but even
> our medium-class commercial IDE only supports per-filetype tab widths.
> Is it reasonable to expect per-document widths from Geany?
My experience is that the "bigger" the IDE is, the less control you
have over your files. These IDEs usually expect that the whole project
is managed by them, and all the files use the same file encodings, tab
sizes and line ends. Things work if you really let the IDE control and
manage your sources - otherwise using them is a real pain. So I
wouldn't take the big players as a benchmark here - geany has a
Geany is already pretty feature rich in what you can set per file -
indent type, line ends, syntax highlight, file encoding and from what
I see, tab sizes are probably the only missing piece.
> A fast solution would be to write a simple a plugin that declares keys
> for tab widths 2 to 8, by default Alt+2 to Alt+8, and calls
> sci_send_message(current, SCI_SETTABWIDTH). They won't be saved, but
> at least you'll be able to switch quickly and per-document.
Yes, would be possible, I'm just not sure if it's a good idea to make
a new plugin for every single minor feature. I'm perfectly fine with
tab sizes not being saved into the sessions file though - I was
suggesting this just to make things consistent with the other
settings, but it's OK for me if this feature is not implemented (less
work for me).
>From technical point of view I think it's better to call the API
function editor_set_indent_type() - I believe this way the custom tab
size would be preserved even when the document is reloaded (but I
haven't studied the sources much so I may be wrong).
> BTW, there is a bug in the Project -> Preferences: when changing the
> indentation Width, at least with Type:Tabs, the previous width is
> applied, instead of the current one. Edit -> Preferences works fine.
I knew there was something like that - I experienced something similar
too. I may look at it if I have some time left.
> E-gards: Jimmy
> Geany-devel mailing list
> Geany-devel at uvena.de
More information about the Devel