mirror of
https://github.com/neovim/neovim
synced 2025-07-21 05:42:46 +00:00
fix(move): check the correct buffer (#25698)
This commit is contained in:
@ -247,7 +247,7 @@ void update_topline(win_T *wp)
|
|||||||
int old_topfill = wp->w_topfill;
|
int old_topfill = wp->w_topfill;
|
||||||
|
|
||||||
// If the buffer is empty, always set topline to 1.
|
// If the buffer is empty, always set topline to 1.
|
||||||
if (buf_is_empty(curbuf)) { // special case - file is empty
|
if (buf_is_empty(wp->w_buffer)) { // special case - file is empty
|
||||||
if (wp->w_topline != 1) {
|
if (wp->w_topline != 1) {
|
||||||
redraw_later(wp, UPD_NOT_VALID);
|
redraw_later(wp, UPD_NOT_VALID);
|
||||||
}
|
}
|
||||||
|
@ -3095,6 +3095,36 @@ it(':substitute with inccommand works properly if undo is not synced #20029', fu
|
|||||||
baz]])
|
baz]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it(':substitute with inccommand does not unexpectedly change viewport #25697', function()
|
||||||
|
clear()
|
||||||
|
local screen = Screen.new(45, 5)
|
||||||
|
common_setup(screen, 'nosplit', long_multiline_text)
|
||||||
|
command('vnew | tabnew | tabclose')
|
||||||
|
screen:expect([[
|
||||||
|
^ │£ m n |
|
||||||
|
{15:~ }│t œ ¥ |
|
||||||
|
{15:~ }│ |
|
||||||
|
{11:[No Name] }{10:[No Name] [+] }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed(':s/')
|
||||||
|
screen:expect([[
|
||||||
|
│£ m n |
|
||||||
|
{15:~ }│t œ ¥ |
|
||||||
|
{15:~ }│ |
|
||||||
|
{11:[No Name] }{10:[No Name] [+] }|
|
||||||
|
:s/^ |
|
||||||
|
]])
|
||||||
|
feed('<Esc>')
|
||||||
|
screen:expect([[
|
||||||
|
^ │£ m n |
|
||||||
|
{15:~ }│t œ ¥ |
|
||||||
|
{15:~ }│ |
|
||||||
|
{11:[No Name] }{10:[No Name] [+] }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
it('long :%s/ with inccommand does not collapse cmdline', function()
|
it('long :%s/ with inccommand does not collapse cmdline', function()
|
||||||
clear()
|
clear()
|
||||||
local screen = Screen.new(10,5)
|
local screen = Screen.new(10,5)
|
||||||
|
Reference in New Issue
Block a user