{
row = statusline_row(wp);
fillchar = fillchar_status(&attr, wp);
- maxwidth = wp->w_width;
+ int in_status_line = wp->w_status_height != 0;
+ maxwidth = in_status_line ? wp->w_width : Columns;
if (draw_ruler)
{
if (*stl++ != '(')
stl = p_ruf;
}
- col = ru_col - (Columns - wp->w_width);
- if (col < (wp->w_width + 1) / 2)
- col = (wp->w_width + 1) / 2;
- maxwidth = wp->w_width - col;
- if (!wp->w_status_height)
+ col = ru_col - (Columns - maxwidth);
+ if (col < (maxwidth + 1) / 2)
+ col = (maxwidth + 1) / 2;
+ maxwidth -= col;
+ if (!in_status_line)
{
row = Rows - 1;
--maxwidth; // writing in last column may cause scrolling
stl = p_stl;
}
- col += wp->w_wincol;
+ if (in_status_line)
+ col += wp->w_wincol;
}
if (maxwidth <= 0)
cunmap a
endfunc
+func Test_rulerformat_position()
+ CheckScreendump
+
+ let buf = RunVimInTerminal('', #{rows: 2, cols: 20})
+ call term_sendkeys(buf, ":set ruler rulerformat=longish\<CR>")
+ call term_sendkeys(buf, ":set laststatus=0 winwidth=1\<CR>")
+ call term_sendkeys(buf, "\<C-W>v\<C-W>|\<C-W>p")
+ call VerifyScreenDump(buf, 'Test_rulerformat_position', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab