[Geany] tab indents, space aligns support

Andris Raugulis ar at xxxxx
Fri May 15 23:28:46 UTC 2009


> > 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.

I'm not pretty familir with Geany's source, but I could try to implement
it. It will be slow, though. Maybe somebody is willing to work on it and
it will get implemented faster. Of course, if you're willing to include
this feature.

> 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.

Yeah, it is reasonable, because people do use that style (as you've seen
in latest discussions on list). It's applicable when writing SQL code,
commenting or in long conditional statements/expressions and function
parameters.

I thought about how to implement it and came to conclusion that pref
in editor->identation would be the best way. Dunno how it could be
named, though. How could it work:

tab:
	single line -> insert single tab at cursor
	multi line -> insert single tab at the start of line
	              (ident always starts at the beginning of line)

shift+tab:
	single line -> (already works fine, removing tab at cursor)
	multi line -> remove tab from beginning of the line

I think that would cover it, won't it? Or I've made some flaws?

> 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.

I do read *BSD source code (in C) and it doesn't use this particular
style, but I have seen in some apps that they do use this coding style.
In web apps field, I've seen it quite much.

And yes, the best thing about this coding style is that everybody who
works on the code can have custom tab settings and because of space
alignment it will be readable no matter what.




More information about the Users mailing list