aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluukvbaal <31730729+luukvbaal@users.noreply.github.com>2023-04-10 02:39:27 +0200
committerGitHub <noreply@github.com>2023-04-10 08:39:27 +0800
commit3c724fe1f3efae0d00b43e381523ea2ec7229328 (patch)
treec80e59393401e1b809dc7d4db5b275c8d73966e8 /src
parentd52cc668c736ef6ca7ee3655a7eb7fe6475afadc (diff)
downloadrneovim-3c724fe1f3efae0d00b43e381523ea2ec7229328.tar.gz
rneovim-3c724fe1f3efae0d00b43e381523ea2ec7229328.tar.bz2
rneovim-3c724fe1f3efae0d00b43e381523ea2ec7229328.zip
fix(column): 'statuscolumn' not drawn after virt_lines with "n" in 'cpo' (#22967)
Problem: The 'statuscolumn' is not drawn and the line itself is drawn at an offset to the rest of the buffer after virt_lines if 'cpoptions' includes "n". Solution: Make sure 'statuscolumn' is drawn.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/drawline.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index a05fb4e08e..fcac837993 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -2967,16 +2967,17 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
wlv.need_showbreak = true;
}
if (statuscol.draw) {
- if (wlv.row == startrow + wlv.filler_lines + 1
- || wlv.row == startrow + wlv.filler_lines) {
- // Re-evaluate 'statuscolumn' for the first wrapped row and non filler line
- statuscol.textp = NULL;
- } else if (statuscol.textp) {
+ if (wlv.row == startrow + wlv.filler_lines) {
+ statuscol.textp = NULL; // re-evaluate for first non-filler line
+ } else if (vim_strchr(p_cpo, CPO_NUMCOL) && wlv.row > startrow + wlv.filler_lines) {
+ statuscol.draw = false; // don't draw status column if "n" is in 'cpo'
+ } else if (wlv.row == startrow + wlv.filler_lines + 1) {
+ statuscol.textp = NULL; // re-evaluate for first wrapped line
+ } else {
// Draw the already built 'statuscolumn' on the next wrapped or filler line
statuscol.textp = statuscol.text;
statuscol.hlrecp = statuscol.hlrec;
- } // Fall back to default columns if the 'n' flag isn't in 'cpo'
- statuscol.draw = vim_strchr(p_cpo, CPO_NUMCOL) == NULL;
+ }
}
wlv.filler_todo--;
virt_line_offset = -1;