diff options
| author | Hugo Musso Gualandi <hugo_musso_gualandi@hotmail.com> | 2021-09-11 00:51:12 -0300 |
|---|---|---|
| committer | Hugo Musso Gualandi <hugo_musso_gualandi@hotmail.com> | 2021-09-11 01:29:01 -0300 |
| commit | aa1a2803093348e4d18244af7c9785c32041abbe (patch) | |
| tree | 6d21d3c501ecf5f31effe9260add93de5dbb678e /src/input_handler.cc | |
| parent | 8755fc679e265727ed5cb858c156dfdba51ae718 (diff) | |
lua.kak: more accurate "end" insertion
- Also insert "end" after "do", "else" and "elseif"
- Do not insert "end" after strings or comments containing keywords
- Only insert "end" if the block is empty
An example of the last item is if we want to add a new line to the start
of an unclosed block that already contains statements. @ is the cursor.
-- before
if a then@
x = 1
y = 2
-- after
if a then
@
end
x = 1
y = 2
In this case, inserting the "end" before the statements is probably not
what the programmer wants. It might make more sense to insert the "end"
after the statements, but that is potentially confusing due to spooky
action at a distance. I think the least confusing thing to do in this
situation is to not insert the "end".
Diffstat (limited to 'src/input_handler.cc')
0 files changed, 0 insertions, 0 deletions
