ajaxorg/ace — pull request #834 by tstarling (2012-07-05 05:45:53+00:00)
Title: Improved Lua indenting

Improved Lua indenting:

* Support single-line blocks: don't indent the following line.
* Indent the line following a line with unclosed parentheses, such as a
function call where some parameters are specified on the same line as
the name.
* Use a negative next-line indent to restore the correct indenting level
after the end of a multi-line parenthesized block where the ending
parenthesis occurs with other text on the same line as it.
* Implement outdenting. Outdenting is triggered after "enter" is pressed,
similar to the Python mode. This avoids problems with incomplete token
information, e.g. outdenting when the user is halfway through typing a
quoted string "the end is nigh", where "end" is recognised as a
keyword until the right quote is present.

Of course it is still flawed, anything less than a complete Lua parser will be flawed, but I'm pretty confident that the code here is better than what came before.