patch 8.1.2281: 'showbreak' cannot be set for one window
Problem: 'showbreak' cannot be set for one window.
Solution: Make 'showbreak' global-local.
diff --git a/src/normal.c b/src/normal.c
index c20c072..76b1fa0 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1768,13 +1768,16 @@
{
# 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 @@
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