nvim_buf_set_text in insert mode should update dot repeat #19806
Labels
api
libnvim, Nvim RPC API
bug
issues reporting wrong behavior
insert-mode
needs:discussion
For PRs that propose significant changes to some part of the architecture or API
Neovim version (nvim -v)
NVIM v0.8.0-dev+141-g55187de11
Vim (not Nvim) behaves the same?
N/A
Operating system/version
N/A
Terminal name/version
N/A
$TERM environment variable
N/A
Installation
N/A
How to reproduce the issue
Given the following steps in lua:
Expected behavior
The buffer contains "two".
Actual behavior
The buffer is empty (the ciw was repeated, but not the insertion).
nvim_buf_set_text
should only update dot repeat if the change is in one continuous region (someone typing or deleting). The changes should be accumulated until there is a discontunity.Essentially, if
start == end
(insertion), orreplacement == [""]
(deletion), dot-repeat should accumulate just likenvim_input
in insert mode.Background
This is very important for vscode-neovim to improve reliablility and remove significant workarounds and bloat.
vscode-neovim/vscode-neovim#992
Vscode handles typing in insert mode, and then sends document changes to nvim via
nvim_buf_set_text
ornvim_buf_set_lines
. However, because neovim does not properly record dot repeat, a workaround is currently needed that opens a scratch buffer, replays the changes by typing, and then returns to the original buffer.The text was updated successfully, but these errors were encountered: