diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-05-09 14:26:03 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-05-22 13:49:42 +0200 |
commit | a78fd18ed92d7474d10b5640dcf7a15728d2e03a (patch) | |
tree | 9123221c9391e661771288d03fdfa704b003ef13 /test | |
parent | 29da1a9cf0b44f2edcbff9e45af283f235360947 (diff) | |
download | rneovim-a78fd18ed92d7474d10b5640dcf7a15728d2e03a.tar.gz rneovim-a78fd18ed92d7474d10b5640dcf7a15728d2e03a.tar.bz2 rneovim-a78fd18ed92d7474d10b5640dcf7a15728d2e03a.zip |
fix(extmark): fix cursor position with both left and right gravity inline text
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index f67c4be419..e8847258f4 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -1745,6 +1745,49 @@ bbbbbbb]]) ]]} end) + it('cursor position is correct when inserting around virtual texts with both left and right gravity ', function() + insert('foo foo foo foo') + meths.buf_set_extmark(0, ns, 0, 8, { virt_text = {{ '>>', 'Special' }}, virt_text_pos = 'inline', right_gravity = false }) + meths.buf_set_extmark(0, ns, 0, 8, { virt_text = {{ '<<', 'Special' }}, virt_text_pos = 'inline', right_gravity = true }) + feed('08l') + screen:expect{ grid = [[ + foo foo {28:>><<}^foo foo | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + + feed('i') + screen:expect { grid = [[ + foo foo {28:>>^<<}foo foo | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {24:-- INSERT --} | + ]]} + end) + it('draws correctly with no wrap multiple virtual text, where one is hidden', function() insert('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz') command("set nowrap") |