diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2023-04-17 16:41:20 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-04-17 16:41:20 +0100 |
commit | fc8a601c3251c0388a88c1235b18c529385f7196 (patch) | |
tree | 753fd75ef5f9c60a2b4d61d6adbdc97ade5ea784 /src/screen.c | |
parent | 961b2e54bdbe1c06e4bf8ccf7a7e3deb129b45de (diff) | |
download | vim-git-fc8a601c3251c0388a88c1235b18c529385f7196.tar.gz |
patch 9.0.1461: ruler not drawn correctly when using 'rulerformat'v9.0.1461
Problem: Ruler not drawn correctly when using 'rulerformat'.
Solution: Adjust formatting depending on whether the ruler is drawn in the
statusline or the command line. (Sean Dewar, closes #12246)
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/screen.c b/src/screen.c index 6d48ad712..cbf2ab3d8 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1043,7 +1043,8 @@ win_redr_custom( { 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) { @@ -1060,11 +1061,11 @@ win_redr_custom( 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 @@ -1084,7 +1085,8 @@ win_redr_custom( stl = p_stl; } - col += wp->w_wincol; + if (in_status_line) + col += wp->w_wincol; } if (maxwidth <= 0) |