On 10/11/13 21:55, Lex Trotman wrote:
We have had long discussions about configurable approaches, but any that seem to provide a useful improvement also seem to add just as many annoying erroneous situations.
PS just a note that most methods seem to fail with things like indentation for lines that are continuations of expressions, function calls and similar situations. Or they only work if you use one specific style of source layout such as GNU style. Or they fail to respect manually set indentation for situations above.
Personally I think the existing system works fine. Snippets with tabs configurable to display at any width, with the option to convert to spaces, is ideal for me. The existing ability to set the tab width, or whether to insert spaces as tab, in a filetype definition is ideal. That’s all the language-specific indentation I need.
In my experience, over-aggressive ‘style enforcers’ are an annoyance more often than they are a help. A case in point being Emacs, where there seems to be no single option to set any single brace style for *all* C-like languages except that personally endorsed by Richard Stallman. That was the main reason Emacs went in the bin for me.
‘Unindentation’ as per Doug’s request would be nice to add to snippets, if it’s feasible, but apart from that the existing system treads the right line between being a helping hand and treading on your toes. Like most things in Geany, which is why I use it. If I wanted text editing to feel like wrestling Leviathan I’d use vi or Emacs... :)
Anyway, just my two cents, but getting back to Doug’s request, adding something like
[Lua] then=then\n\t%cursor% else=else\n\t%cursor% do=do\n\t%cursor%
to snippets.conf approximates what he was asking for, minus unindentation.
James