mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(screen): redraw the ruler for a current floating window
Semi-regression. The "ruler" behavior for a floating window was never really specified but in practice followed the users cursor movements in normal mode in a focused float, which seems like a reasonable behavior to now specify.
This commit is contained in:
parent
f01f18cdf4
commit
0f1e2b6686
@ -746,7 +746,7 @@ void show_cursor_info_later(bool force)
|
|||||||
|| curwin->w_topfill != curwin->w_stl_topfill
|
|| curwin->w_topfill != curwin->w_stl_topfill
|
||||||
|| empty_line != curwin->w_stl_empty
|
|| empty_line != curwin->w_stl_empty
|
||||||
|| state != curwin->w_stl_state) {
|
|| state != curwin->w_stl_state) {
|
||||||
if ((curwin->w_status_height || global_stl_height())) {
|
if (curwin->w_status_height || global_stl_height()) {
|
||||||
curwin->w_redr_status = true;
|
curwin->w_redr_status = true;
|
||||||
} else {
|
} else {
|
||||||
redraw_cmdline = true;
|
redraw_cmdline = true;
|
||||||
|
@ -608,7 +608,7 @@ int showmode(void)
|
|||||||
|
|
||||||
// If the last window has no status line and global statusline is disabled,
|
// If the last window has no status line and global statusline is disabled,
|
||||||
// the ruler is after the mode message and must be redrawn
|
// the ruler is after the mode message and must be redrawn
|
||||||
win_T *last = lastwin_nofloating();
|
win_T *last = curwin->w_floating ? curwin : lastwin_nofloating();
|
||||||
if (redrawing() && last->w_status_height == 0 && global_stl_height() == 0) {
|
if (redrawing() && last->w_status_height == 0 && global_stl_height() == 0) {
|
||||||
win_redr_ruler(last);
|
win_redr_ruler(last);
|
||||||
}
|
}
|
||||||
|
@ -2184,6 +2184,98 @@ describe('float window', function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('show ruler of current floating window', function()
|
||||||
|
command 'set ruler'
|
||||||
|
local buf = meths.create_buf(false, false)
|
||||||
|
meths.buf_set_lines(buf, 0, -1, true, {'aaa aab ',
|
||||||
|
'abb acc '})
|
||||||
|
meths.open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5})
|
||||||
|
feed 'gg'
|
||||||
|
|
||||||
|
if multigrid then
|
||||||
|
screen:expect{grid=[[
|
||||||
|
## grid 1
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[3:----------------------------------------]|
|
||||||
|
## grid 2
|
||||||
|
|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
## grid 3
|
||||||
|
1,1 All |
|
||||||
|
## grid 5
|
||||||
|
{1:^aaa aab }|
|
||||||
|
{1:abb acc }|
|
||||||
|
{2:~ }|
|
||||||
|
]], float_pos={
|
||||||
|
[5] = {{id = 1002}, "NW", 1, 0, 5, true, 50};
|
||||||
|
}, win_viewport={
|
||||||
|
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
||||||
|
[5] = {win = {id = 1002}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
|
||||||
|
}}
|
||||||
|
else
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1:^aaa aab } |
|
||||||
|
{0:~ }{1:abb acc }{0: }|
|
||||||
|
{0:~ }{2:~ }{0: }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
1,1 All |
|
||||||
|
]]}
|
||||||
|
end
|
||||||
|
|
||||||
|
feed 'w'
|
||||||
|
if multigrid then
|
||||||
|
screen:expect{grid=[[
|
||||||
|
## grid 1
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[3:----------------------------------------]|
|
||||||
|
## grid 2
|
||||||
|
|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
## grid 3
|
||||||
|
1,5 All |
|
||||||
|
## grid 5
|
||||||
|
{1:aaa ^aab }|
|
||||||
|
{1:abb acc }|
|
||||||
|
{2:~ }|
|
||||||
|
]], float_pos={
|
||||||
|
[5] = {{id = 1002}, "NW", 1, 0, 5, true, 50};
|
||||||
|
}, win_viewport={
|
||||||
|
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
||||||
|
[5] = {win = {id = 1002}, topline = 0, botline = 3, curline = 0, curcol = 4, linecount = 2, sum_scroll_delta = 0};
|
||||||
|
}}
|
||||||
|
else
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1:aaa ^aab } |
|
||||||
|
{0:~ }{1:abb acc }{0: }|
|
||||||
|
{0:~ }{2:~ }{0: }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
1,5 All |
|
||||||
|
]]}
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
it('can have minimum size', function()
|
it('can have minimum size', function()
|
||||||
insert("the background text")
|
insert("the background text")
|
||||||
local buf = meths.create_buf(false, true)
|
local buf = meths.create_buf(false, true)
|
||||||
|
@ -1351,7 +1351,7 @@ local function fmt_ext_state(name, state)
|
|||||||
for k,v in pairs(state) do
|
for k,v in pairs(state) do
|
||||||
str = (str.." ["..k.."] = {win = {id = "..v.win.id.."}, topline = "
|
str = (str.." ["..k.."] = {win = {id = "..v.win.id.."}, topline = "
|
||||||
..v.topline..", botline = "..v.botline..", curline = "..v.curline
|
..v.topline..", botline = "..v.botline..", curline = "..v.curline
|
||||||
..", curcol = "..v.curcol..", linecount = "..v.linecount..", scroll_delta = "..v.scroll_delta.."};\n")
|
..", curcol = "..v.curcol..", linecount = "..v.linecount..", sum_scroll_delta = "..v.sum_scroll_delta.."};\n")
|
||||||
end
|
end
|
||||||
return str .. "}"
|
return str .. "}"
|
||||||
elseif name == "float_pos" then
|
elseif name == "float_pos" then
|
||||||
|
Loading…
Reference in New Issue
Block a user