mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
fix(grid): add start column when getting char on line (#25627)
This commit is contained in:
parent
ebe489d8f0
commit
9f32deba56
@ -352,6 +352,7 @@ void grid_line_start(ScreenGrid *grid, int row)
|
||||
schar_T grid_line_getchar(int col, int *attr)
|
||||
{
|
||||
if (col < grid_line_maxcol) {
|
||||
col += grid_line_coloff;
|
||||
size_t off = grid_line_grid->line_offset[grid_line_row] + (size_t)col;
|
||||
if (attr != NULL) {
|
||||
*attr = grid_line_grid->attrs[off];
|
||||
|
@ -192,4 +192,38 @@ describe('insert-mode', function()
|
||||
feed('i<C-S-V><C-J><C-S-V><C-@><C-S-V><C-[><C-S-V><C-S-M><C-S-V><M-C-I><C-S-V><C-D-J><Esc>')
|
||||
expect('<C-J><C-@><C-[><C-S-M><M-C-I><C-D-J>')
|
||||
end)
|
||||
|
||||
it('multi-char mapping updates screen properly #25626', function()
|
||||
local screen = Screen.new(60, 6)
|
||||
screen:set_default_attr_ids({
|
||||
[0] = {bold = true, foreground = Screen.colors.Blue}; -- NonText
|
||||
[1] = {bold = true, reverse = true}; -- StatusLine
|
||||
[2] = {reverse = true}; -- StatusLineNC
|
||||
[3] = {bold = true}; -- ModeMsg
|
||||
})
|
||||
screen:attach()
|
||||
command('vnew')
|
||||
insert('foo\nfoo\nfoo')
|
||||
command('wincmd w')
|
||||
command('set timeoutlen=10000')
|
||||
command('inoremap jk <Esc>')
|
||||
feed('i<CR>βββ<Left><Left>j')
|
||||
screen:expect{grid=[[
|
||||
foo │ |
|
||||
foo │β^jβ |
|
||||
foo │{0:~ }|
|
||||
{0:~ }│{0:~ }|
|
||||
{2:[No Name] [+] }{1:[No Name] [+] }|
|
||||
{3:-- INSERT --} |
|
||||
]]}
|
||||
feed('k')
|
||||
screen:expect{grid=[[
|
||||
foo │ |
|
||||
foo │^βββ |
|
||||
foo │{0:~ }|
|
||||
{0:~ }│{0:~ }|
|
||||
{2:[No Name] [+] }{1:[No Name] [+] }|
|
||||
|
|
||||
]]}
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user