diff src/normal.c @ 18574:8b0114ffde2b v8.1.2281

patch 8.1.2281: 'showbreak' cannot be set for one window Commit: https://github.com/vim/vim/commit/ee85702c10495041791f728e977b86005c4496e8 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 9 23:26:40 2019 +0100 patch 8.1.2281: 'showbreak' cannot be set for one window Problem: 'showbreak' cannot be set for one window. Solution: Make 'showbreak' global-local.
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 Nov 2019 23:30:03 +0100
parents 63ee3c2b140f
children bbea1f108187
line wrap: on
line diff
--- a/src/normal.c
+++ b/src/normal.c
@@ -1768,13 +1768,16 @@ clear_showcmd(void)
 	{
 # ifdef FEAT_LINEBREAK
 	    char_u *saved_sbr = p_sbr;
+	    char_u *saved_w_sbr = curwin->w_p_sbr;
 
 	    /* Make 'sbr' empty for a moment to get the correct size. */
 	    p_sbr = empty_option;
+	    curwin->w_p_sbr = empty_option;
 # endif
 	    getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol);
 # ifdef FEAT_LINEBREAK
 	    p_sbr = saved_sbr;
+	    curwin->w_p_sbr = saved_w_sbr;
 # endif
 	    sprintf((char *)showcmd_buf, "%ldx%ld", lines,
 					      (long)(rightcol - leftcol + 1));
@@ -2577,8 +2580,8 @@ nv_screengo(oparg_T *oap, int dir, long 
 	validate_virtcol();
 	virtcol = curwin->w_virtcol;
 #if defined(FEAT_LINEBREAK)
-	if (virtcol > (colnr_T)width1 && *p_sbr != NUL)
-	    virtcol -= vim_strsize(p_sbr);
+	if (virtcol > (colnr_T)width1 && *get_showbreak_value(curwin) != NUL)
+	    virtcol -= vim_strsize(get_showbreak_value(curwin));
 #endif
 
 	if (virtcol > curwin->w_curswant