[Geany] tab indents, space aligns support - Re: tab identation

Nick Treleaven nick.treleaven at xxxxx
Wed May 13 14:59:25 UTC 2009


On Sun, 10 May 2009 06:46:40 +0300
Andris Raugulis <ar at null.lv> wrote:

> > I can't remember such a feature. Leading spaces and tabs are generally 
> > indentation. And pressing shift+tab removes it. If you re-add it, it 
> > only adds the indention type you've configured.
> 
> As I mentioned, unchecking "Tab key idents", I get desired results, so,
> in my opinion, it should be possible for multi-lines, also. 
> 
> And Now I think I remember that shift+tab was the one that used to work
> for multiple-lines. Anyway, one way or other (tab or shift+tab), it used
> to work. I'm pretty sure. Or my memory is broken.

We changed the implementation of indentation when introducing the 'Tabs
and Spaces' mode (which is for tab 'compression' of spaces).

Shift+tab just unindents when 'Tab key indents' is enabled.

> Anyway, if I can't do this by configuration, how can I achieve my desired
> results? Snippet, plugin, local patch-branch?

Unfortunately this isn't supported ATM.

In src/editor.c you might be able to modify insert_indent_after_line(),
but there are probably other places that need changes too.

> > Besides, I find it weird to even want such a mixed indentation. Why not 
> > use tabs or spaces consistently?
> 
> It's not pure identation. It's ident + align. And to answer your
> question - to make code readable. Consider this code (php example):
> 
> ->->$sSQL = 'SELECT `column1` ' .
> ->->........'  FROM `table` ' .
> ->->........' WHERE `column2` = (..)
> 
> I use tab for ident, space for align.
> 
> In this way every developer who works on code can have custom settings
> for his "tab" key - be it 2, 4, 8 or whatver-count chars wide. And code
> will be readable for all of them.

I think this is a reasonable request, but Geany would need to add
support for it. Perhaps there could be a pref that only works in tabs
or spaces indent mode.

BTW, any idea how much code uses the tabs for indent and spaces for
align? I think I ran across some in ctags, so I guess it might be quite
popular so the user can use any tab width they like.

Regards,
Nick



More information about the Users mailing list