mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #8358 from mhinz/screen
[RFC] screen: avoid artifacts
This commit is contained in:
@@ -5310,7 +5310,9 @@ void screen_getbytes(int row, int col, char_u *bytes, int *attrp)
|
|||||||
bytes[0] = ScreenLines[off];
|
bytes[0] = ScreenLines[off];
|
||||||
bytes[1] = NUL;
|
bytes[1] = NUL;
|
||||||
|
|
||||||
bytes[utfc_char2bytes(off, bytes)] = NUL;
|
if (ScreenLinesUC[off] != 0) {
|
||||||
|
bytes[utfc_char2bytes(off, bytes)] = NUL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -701,4 +701,43 @@ describe('Screen', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Regression test for #8357
|
||||||
|
it('does not have artifacts after temporary chars in insert mode', function()
|
||||||
|
command('inoremap jk <esc>')
|
||||||
|
feed('ifooj')
|
||||||
|
screen:expect([[
|
||||||
|
foo^j |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{2:-- INSERT --} |
|
||||||
|
]])
|
||||||
|
feed('k')
|
||||||
|
screen:expect([[
|
||||||
|
fo^o |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user