summaryrefslogtreecommitdiff
path: root/autoload/vim_ai.vim
diff options
context:
space:
mode:
authorMichael Buckley <iammikebuckley@gmail.com>2024-06-04 11:21:27 -0400
committerMichael Buckley <iammikebuckley@gmail.com>2024-06-04 11:21:27 -0400
commitf76aa3fdc4ac5f46145db8937bf10c04fa7c97dc (patch)
tree75606598c28e6c19c4bbc65adf58022ef59b9272 /autoload/vim_ai.vim
parent437d4e68fd58ca2abb2e8323522f6e4c5fec3198 (diff)
downloadvim-ai-f76aa3fdc4ac5f46145db8937bf10c04fa7c97dc.tar.gz
Fix print_info_message <Esc> issue
I ran into an issue when first using this plugin where the print_info_message function wasn't working correctly due to vim misinterpreting the <Esc> sequence in `vim.command("normal \\<Esc>")` as a series of individual characters rather than a single literal Escape character. This resulted in the characters 'c>' being inserted into the active buffer at the cursor location because the 's' in '<Esc>' was being interpreted as a normal mode 's', causing it to enter insert mode, and none of the info messages were being echoed properly. This was frustrating as it was not easy to figure out why my commands weren't working initially (turns out I hadn't configured my billing plan correctly, d'oh). Fix this by using a more robust way of sending the <Esc> character to vim via `vim.command('call feedkeys("\<Esc>")')`. The usage of double quotes inside the feedkeys() call is important because it causes vim to treat the sequence as a proper escape sequence rather than a series of individual characters (see :h feedkeys).
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions