diff options
| author | Hugo Musso Gualandi <hugo_musso_gualandi@hotmail.com> | 2021-09-10 01:43:59 -0300 |
|---|---|---|
| committer | Hugo Musso Gualandi <hugo_musso_gualandi@hotmail.com> | 2021-09-11 01:27:41 -0300 |
| commit | 8755fc679e265727ed5cb858c156dfdba51ae718 (patch) | |
| tree | ebcac9b2b1c44d1c3cba78d183c8359183bf46f1 /src | |
| parent | ffc69544db0c883ff1992d7f2825233e6bc7e472 (diff) | |
lua.kak: improve the indentation logic
This commit makes several improvements to the Lua indentation logic.
- Don't indent if the keyword is inside a string or comment
- Indent inside "do end"
- Indent inside "repeat until"
- Indent after a line ending with "{" or "("
- More accurate un-indentation for the "end" keyword
For the last point, previously we tried to match the indentation of the
starting keyword of the block. However, sometimes this guessed wrong
and produced the wrong indentation, as the following example shows. The
new logic is to indent the "end" by one less level than the contents of
the block.
while true do
if false then
end
end -- This was incorrectly matched with the "if"
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions
