mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(marks): handle composing in inline virt_text with 'nowrap' (#32477)
This commit is contained in:
parent
8452032554
commit
906ad04ddd
@ -914,10 +914,10 @@ static void handle_inline_virtual_text(win_T *wp, winlinevars_T *wlv, ptrdiff_t
|
||||
int cells_to_skip = wlv->skip_cells;
|
||||
// Skip cells in the text.
|
||||
while (cells_to_skip > 0) {
|
||||
int clen = utf_ptr2len(wlv->p_extra);
|
||||
int c_len = utfc_ptr2len(wlv->p_extra);
|
||||
cells_to_skip -= utf_ptr2cells(wlv->p_extra);
|
||||
wlv->p_extra += clen;
|
||||
wlv->n_extra -= clen;
|
||||
wlv->p_extra += c_len;
|
||||
wlv->n_extra -= c_len;
|
||||
wlv->n_attr--;
|
||||
}
|
||||
// If a double-width char doesn't fit, pad with space.
|
||||
|
@ -3379,59 +3379,59 @@ describe('decorations: inline virtual text', function()
|
||||
insert('12345678')
|
||||
command('set nowrap')
|
||||
api.nvim_buf_set_extmark(0, ns, 0, 2, {
|
||||
virt_text = { { 'αβγ口=', 'Special' }, { '口', 'Special' } },
|
||||
virt_text = { { 'αβ̳γ̲口=', 'Special' }, { '❤️', 'Special' } },
|
||||
virt_text_pos = 'inline',
|
||||
})
|
||||
screen:expect([[
|
||||
12{10:αβγ口=口}34567^8 |
|
||||
12{10:αβ̳γ̲口=❤️}34567^8 |
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
feed('zl')
|
||||
screen:expect([[
|
||||
2{10:αβγ口=口}34567^8 |
|
||||
2{10:αβ̳γ̲口=❤️}34567^8 |
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
feed('zl')
|
||||
screen:expect([[
|
||||
{10:αβγ口=口}34567^8 |
|
||||
{10:αβ̳γ̲口=❤️}34567^8 |
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
feed('zl')
|
||||
screen:expect([[
|
||||
{10:βγ口=口}34567^8 |
|
||||
{10:β̳γ̲口=❤️}34567^8 |
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
feed('zl')
|
||||
screen:expect([[
|
||||
{10:γ口=口}34567^8 |
|
||||
{10:γ̲口=❤️}34567^8 |
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
feed('zl')
|
||||
screen:expect([[
|
||||
{10:口=口}34567^8 |
|
||||
{10:口=❤️}34567^8 |
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
feed('zl')
|
||||
screen:expect([[
|
||||
{10: =口}34567^8 |
|
||||
{10: =❤️}34567^8 |
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
feed('zl')
|
||||
screen:expect([[
|
||||
{10:=口}34567^8 |
|
||||
{10:=❤️}34567^8 |
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
feed('zl')
|
||||
screen:expect([[
|
||||
{10:口}34567^8 |
|
||||
{10:❤️}34567^8 |
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
|
Loading…
Reference in New Issue
Block a user