aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Coudron <teto@users.noreply.github.com>2021-01-05 21:23:35 +0100
committerGitHub <noreply@github.com>2021-01-05 21:23:35 +0100
commit2ea3127697692b0b2c480d585ef6529e90a72b0e (patch)
tree513894134334ff7756d3ae44ad8c23b1f64f9d8c
parent2bfd0ba8aed19e11349403578bfe305106a7fe88 (diff)
downloadrneovim-2ea3127697692b0b2c480d585ef6529e90a72b0e.tar.gz
rneovim-2ea3127697692b0b2c480d585ef6529e90a72b0e.tar.bz2
rneovim-2ea3127697692b0b2c480d585ef6529e90a72b0e.zip
screen.c: fix display of signcolumn=auto in diffs (#13688)
sign_id was not reset when filler lines were involved, thus causing a bad alignment between columns. You could check that before this commit, bin/nvim -u NORC --cmd "setglobal signcolumn=yes:4" --cmd "set diffopt+=foldcolumn:0" -d ../test1.txt ../test2.txt would result in an irregular column width.
-rw-r--r--src/nvim/screen.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index a7fd2bfcc6..377e8f58fa 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -2665,7 +2665,7 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow,
}
}
- //sign column
+ // sign column, this is hit until sign_idx reaches count
if (draw_state == WL_SIGN - 1 && n_extra == 0) {
draw_state = WL_SIGN;
/* Show the sign column when there are any signs in this
@@ -4347,6 +4347,10 @@ void screen_adjust_grid(ScreenGrid **grid, int *row_off, int *col_off)
// Get information needed to display the sign in line 'lnum' in window 'wp'.
// If 'nrcol' is TRUE, the sign is going to be displayed in the number column.
// Otherwise the sign is going to be displayed in the sign column.
+//
+// @param count max number of signs
+// @param[out] n_extrap number of characters from pp_extra to display
+// @param[in, out] sign_idxp Index of the displayed sign
static void get_sign_display_info(
bool nrcol,
win_T *wp,
@@ -4423,6 +4427,8 @@ static void get_sign_display_info(
(*sign_idxp)++;
if (*sign_idxp < count) {
*draw_statep = WL_SIGN - 1;
+ } else {
+ *sign_idxp = 0;
}
}