diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-06-02 15:37:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-02 15:37:11 +0800 |
commit | 24cb9ba6d32918beaba5a2109f5f8d8009cd097d (patch) | |
tree | 2e4d35fd4388b56389659e64f95da2cc8ed994a2 /test/functional/lua/buffer_updates_spec.lua | |
parent | 05435a915a8446a8c2d824551fbea2dc1d7b5e98 (diff) | |
parent | 56337310efc765a760b7a1ca0040c7c6ce23574e (diff) | |
download | rneovim-24cb9ba6d32918beaba5a2109f5f8d8009cd097d.tar.gz rneovim-24cb9ba6d32918beaba5a2109f5f8d8009cd097d.tar.bz2 rneovim-24cb9ba6d32918beaba5a2109f5f8d8009cd097d.zip |
Merge pull request #29136 from zeertzjq/vim-8.2.0083
vim-patch:8.2.{0083,0109}
Diffstat (limited to 'test/functional/lua/buffer_updates_spec.lua')
-rw-r--r-- | test/functional/lua/buffer_updates_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index d4af7e4732..6b575ad0ef 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -379,6 +379,25 @@ describe('lua buffer event callbacks: on_lines', function() ]], }) end) + + it('line lengths are correct when pressing TAB with folding #29119', function() + api.nvim_buf_set_lines(0, 0, -1, true, { 'a', 'b' }) + + exec_lua([[ + _G.res = {} + vim.o.foldmethod = 'indent' + vim.o.softtabstop = -1 + vim.api.nvim_buf_attach(0, false, { + on_lines = function(_, bufnr, _, row, _, end_row) + local lines = vim.api.nvim_buf_get_lines(bufnr, row, end_row, true) + table.insert(_G.res, lines) + end + }) + ]]) + + feed('i<Tab>') + eq({ '\ta' }, exec_lua('return _G.res[#_G.res]')) + end) end) describe('lua: nvim_buf_attach on_bytes', function() |