aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawline.c
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2023-11-13 04:24:02 +0100
committerGitHub <noreply@github.com>2023-11-13 11:24:02 +0800
commitd3582e102b7bd53afb58efb37eca866ec528dfbe (patch)
tree2ce035c45fb4fb9b843b4209cca43caa866de8c9 /src/nvim/drawline.c
parent2a58aa57098a4876afa8d865d6d9ec32407d7f11 (diff)
downloadrneovim-d3582e102b7bd53afb58efb37eca866ec528dfbe.tar.gz
rneovim-d3582e102b7bd53afb58efb37eca866ec528dfbe.tar.bz2
rneovim-d3582e102b7bd53afb58efb37eca866ec528dfbe.zip
feat(statuscolumn): re-evaluate for every screen line (#25885)
Problem: v:virtnum is less useful than it could be. Solution: Always re-evaluate 'statuscolumn', and update v:virtnum accordingly.
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r--src/nvim/drawline.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 2ef1083cf8..5f61848188 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -3124,16 +3124,10 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
wlv.need_showbreak = true;
}
if (statuscol.draw) {
- 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) {
+ 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;
+ statuscol.textp = NULL; // re-evaluate with new v:virtnum
}
}
wlv.filler_todo--;