lua.kak: more accurate "end" insertion
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".

casimir/kakoune,mawww/kakoune,alexherbo2/kakoune,alexherbo2/kakoune,jkonecny12/kakoune,mawww/kakoune,mawww/kakoune,casimir/kakoune,jkonecny12/kakoune,jkonecny12/kakoune,casimir/kakoune,mawww/kakoune,jkonecny12/kakoune,alexherbo2/kakoune,casimir/kakoune,alexherbo2/kakoune