tauraamui / lilly

TUI editor and VIM/Neovim alternative
Apache License 2.0
83 stars 4 forks source link

Prevent pointless backtrack movement of char on `ESC` #140

Closed tauraamui closed 2 weeks ago

wilsonk commented 6 months ago

Isn't this the default behavior of Vim? It is on my Linux machine, using Vim 9.1 and nvim 0.6-dev, at least.

I believe they keep this behavior so that they don't have to calculate anything, or do anything different, if they use 'A' to append at the very end of a line (or if they appened at line_len). If they didn't move back one space on 'escape', in these situations, the cursors position could run off the end of the line buffer (possibly an old holdover from C's null termination behavior?).

Anyways, I think the behavior is correct the way it functions right now. (Even the vim plugin to VSCode exhibits this behavior). Just my two cents :)

tauraamui commented 2 weeks ago

Hmm interesting. I'll close this.