From 3c7cc03f345ace2cdeeb71163ad5ed2c10c59a1f Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 22 Apr 2018 19:43:27 +0300 Subject: screen: Fix PVS/V560: col never reassigned in this part of code --- src/nvim/screen.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 3671537751..8f2b7b1f04 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2140,7 +2140,6 @@ win_line ( bool nochange /* not updating for changed text */ ) { - int col = 0; // visual column on screen unsigned off; // offset in ScreenLines/ScreenAttrs int c = 0; // init for GCC long vcol = 0; // virtual column (for tabs) @@ -2553,7 +2552,7 @@ win_line ( ptr = prev_ptr; // If the character fits on the screen, don't need to skip it. // Except for a TAB. - if (((*mb_ptr2cells)(ptr) >= c || *ptr == TAB) && col == 0) { + if (utf_ptr2cells(ptr) >= c || *ptr == TAB) { n_skip = v - vcol; } } @@ -2702,11 +2701,11 @@ win_line ( } off = (unsigned)(current_ScreenLine - ScreenLines); - col = 0; + int col = 0; // Visual column on screen. if (wp->w_p_rl) { - /* Rightleft window: process the text in the normal direction, but put - * it in current_ScreenLine[] from right to left. Start at the - * rightmost column of the window. */ + // Rightleft window: process the text in the normal direction, but put + // it in current_ScreenLine[] from right to left. Start at the + // rightmost column of the window. col = wp->w_width - 1; off += col; } -- cgit