mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(extmarks): adjust extmarks when inserting prompt prefix
This commit is contained in:
parent
8b86cb8f5b
commit
da70c39405
@ -1484,7 +1484,7 @@ static void init_prompt(int cmdchar_todo)
|
|||||||
}
|
}
|
||||||
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
|
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
|
||||||
coladvance(MAXCOL);
|
coladvance(MAXCOL);
|
||||||
changed_bytes(curbuf->b_ml.ml_line_count, 0);
|
inserted_bytes(curbuf->b_ml.ml_line_count, 0, 0, (colnr_T)strlen(prompt));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert always starts after the prompt, allow editing text after it.
|
// Insert always starts after the prompt, allow editing text after it.
|
||||||
|
@ -1454,6 +1454,14 @@ describe('API/extmarks', function()
|
|||||||
}} }, get_extmarks(ns, 0, -1, {details=true}))
|
}} }, get_extmarks(ns, 0, -1, {details=true}))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('in prompt buffer', function()
|
||||||
|
feed('dd')
|
||||||
|
local id = set_extmark(ns, marks[1], 0, 0, {})
|
||||||
|
curbufmeths.set_option('buftype', 'prompt')
|
||||||
|
feed('i<esc>')
|
||||||
|
eq({{id, 0, 2}}, get_extmarks(ns, 0, -1))
|
||||||
|
end)
|
||||||
|
|
||||||
it('can get details', function()
|
it('can get details', function()
|
||||||
set_extmark(ns, marks[1], 0, 0, {
|
set_extmark(ns, marks[1], 0, 0, {
|
||||||
end_col = 0,
|
end_col = 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user