diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-16 09:31:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-16 09:31:05 +0800 |
commit | 73526abbbdf08e68e572b8e54c583de5a0323484 (patch) | |
tree | 7887fa868cdefc49c1ed501581a2767a3e55d30d /test/functional/api/vim_spec.lua | |
parent | 33da7d83e879e47cc84544507785d4e189b4200e (diff) | |
download | rneovim-73526abbbdf08e68e572b8e54c583de5a0323484.tar.gz rneovim-73526abbbdf08e68e572b8e54c583de5a0323484.tar.bz2 rneovim-73526abbbdf08e68e572b8e54c583de5a0323484.zip |
fix(api): do not switch win/buf if getting option in current win/buf (#19383)
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 989ed27e16..63a4e9a39c 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1469,6 +1469,17 @@ describe('API', function() nvim('win_set_option', win, 'number', true) eq(true, nvim('get_option_value', 'number', {win = win})) end) + + it('getting current buffer option does not adjust cursor #19381', function() + nvim('command', 'new') + local buf = nvim('get_current_buf').id + local win = nvim('get_current_win').id + insert('some text') + feed('0v$') + eq({1, 9}, nvim('win_get_cursor', win)) + nvim('get_option_value', 'filetype', {buf = buf}) + eq({1, 9}, nvim('win_get_cursor', win)) + end) end) describe('nvim_{get,set}_current_buf, nvim_list_bufs', function() |