bufexplorer icon indicating copy to clipboard operation
bufexplorer copied to clipboard

Bufexplorer interferes with the startinsert! command

Open cespare opened this issue 5 years ago • 0 comments

I'm seeing a strange issue that I've isolated to bufexplorer. (That is, it does not occur without bufexplorer loaded, and it does occur with an empty .vimrc and bufexplorer as the single plugin.)

This started happening with more recent vim versions. It does not reproduce in vim 8.0.1453 but it does occur in vim 8.1.something (can't recall which patch) as well as 8.2.65.

Edit any file with at least one line of text. I'll call mine x.txt.

Consider the command

1 | startinsert!

This should go to the first line and then change to insert mode at the very end of the line (as though the user had used the A motion).

This command works fine. However, if at the command-line I run

vim -c '1 | startinsert!' x.txt

then the cursor will be at the second-to-last position in the line rather than at the very end (as though the user typed $i rather than A).

Without bufexplorer loaded, vim -c '1 | startinsert!' x.txt starts vim with the cursor at the very end of the first line, just as though I ran 1 | startinsert! from inside vim.

I did a little bisecting and the problem is caused by this line of code:

https://github.com/jlanzarotta/bufexplorer/blob/162f6031ada3b2d1ad171e02e93f417ee1689176/plugin/bufexplorer.vim#L173

cespare avatar Dec 31 '19 01:12 cespare