diff options
author | Ibby <33922797+SleepySwords@users.noreply.github.com> | 2023-03-26 16:09:09 +1100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-05-22 13:49:42 +0200 |
commit | dee3af2122d5072d351551ef023d2c177334b332 (patch) | |
tree | c54d0d7c45c1ca37e3632d58668fe3c6a31fcd7b /test/functional/ui | |
parent | 43c2eaada220d5e7d44fa9086655b00ee3e5fbb5 (diff) | |
download | rneovim-dee3af2122d5072d351551ef023d2c177334b332.tar.gz rneovim-dee3af2122d5072d351551ef023d2c177334b332.tar.bz2 rneovim-dee3af2122d5072d351551ef023d2c177334b332.zip |
vim-patch:9.0.0178: cursor position wrong with virtual text before Tab
Problem: Cursor position wrong with virtual text before Tab.
Solution: Use the byte length, not the cell with, to compare the column.
Correct tab size after text prop. (closes vim/vim#10866)
https://github.com/vim/vim/commit/e428fa04a758cc87ea580c856a796e58e407504b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/functional/ui')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 635666c941..91284e3a2f 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -1476,6 +1476,111 @@ bbbbbbb]]) | ]]} end) + + it('cursor position is correct with virtual text attatched to hard tabs', function() + command('set noexpandtab') + feed('i') + feed('<TAB>') + feed('<TAB>') + feed('test') + feed('<ESC>') + meths.buf_set_extmark(0, ns, 0, 1, + { virt_text = { { 'virtual text', 'Special' } }, virt_text_pos = 'inline' }) + feed('0') + screen:expect { grid = [[ + ^ {28:virtual text} test | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + + feed('l') + screen:expect { grid = [[ + {28:virtual text} ^ test | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + + feed('l') + screen:expect { grid = [[ + {28:virtual text} ^test | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + + feed('l') + screen:expect { grid = [[ + {28:virtual text} t^est | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + + feed('l') + screen:expect { grid = [[ + {28:virtual text} te^st | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + end) end) describe('decorations: virtual lines', function() |