On 11 November 2013 09:36, James Brierley jmb8710@gmail.com wrote:
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.
Good to see a happy customer :)
Perhaps the rest of us are just lazier, but we would *like* better indentation assistance, but not at the cost of lots of annoyances, like your Emacs one below.
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.
To be fair since each "C-like" language is different (GNU C, Linux C, Stroustrup C++, Java) having one setting is less useful. I have found the latest Emacs indentation to be ok, but its based on code analysis, so its not immediate, you need to finish the language construct before it indents, which is distracting but I could get used to it. But such analysis is not available to Geany. And of course in some languages indentation is significant and required to follow specific rules, Python being the simplest, and Haskell being unfathomable.
‘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... :)
I believe we will always retain the simple indentation types, even if more complex ones are added, so you should be safe. Possibly adding %indent% and %undent% to the snippets would be a good idea, just needs someone to do it.
Cheers Lex
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
-- "Unix is the worst computer operating system, except all the others that have been tried." _______________________________________________ Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users