summaryrefslogtreecommitdiff
path: root/src/charset.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-09 23:26:40 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-09 23:26:40 +0100
commitee85702c10495041791f728e977b86005c4496e8 (patch)
treead3a4d7d4d477299da5349d8b9d234243ca33d66 /src/charset.c
parentb0745b221d284e381f1bd4b591cd68ea54b6a51d (diff)
downloadvim-git-ee85702c10495041791f728e977b86005c4496e8.tar.gz
patch 8.1.2281: 'showbreak' cannot be set for one windowv8.1.2281
Problem: 'showbreak' cannot be set for one window. Solution: Make 'showbreak' global-local.
Diffstat (limited to 'src/charset.c')
-rw-r--r--src/charset.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/charset.c b/src/charset.c
index 09e78203f..25d6d3851 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -936,7 +936,8 @@ lbr_chartabsize(
colnr_T col)
{
#ifdef FEAT_LINEBREAK
- if (!curwin->w_p_lbr && *p_sbr == NUL && !curwin->w_p_bri)
+ if (!curwin->w_p_lbr && *get_showbreak_value(curwin) == NUL
+ && !curwin->w_p_bri)
{
#endif
if (curwin->w_p_wrap)
@@ -991,11 +992,12 @@ win_lbr_chartabsize(
char_u *ps;
int tab_corr = (*s == TAB);
int n;
+ char_u *sbr;
/*
* No 'linebreak', 'showbreak' and 'breakindent': return quickly.
*/
- if (!wp->w_p_lbr && !wp->w_p_bri && *p_sbr == NUL)
+ if (!wp->w_p_lbr && !wp->w_p_bri && *get_showbreak_value(wp) == NUL)
#endif
{
if (wp->w_p_wrap)
@@ -1069,7 +1071,8 @@ win_lbr_chartabsize(
* Set *headp to the size of what we add.
*/
added = 0;
- if ((*p_sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0)
+ sbr = get_showbreak_value(wp);
+ if ((*sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0)
{
colnr_T sbrlen = 0;
int numberwidth = win_col_off(wp);
@@ -1082,9 +1085,9 @@ win_lbr_chartabsize(
numberextra = wp->w_width - (numberextra - win_col_off2(wp));
if (col >= numberextra && numberextra > 0)
col %= numberextra;
- if (*p_sbr != NUL)
+ if (*sbr != NUL)
{
- sbrlen = (colnr_T)MB_CHARLEN(p_sbr);
+ sbrlen = (colnr_T)MB_CHARLEN(sbr);
if (col >= sbrlen)
col -= sbrlen;
}
@@ -1098,7 +1101,7 @@ win_lbr_chartabsize(
if (col == 0 || col + size + sbrlen > (colnr_T)wp->w_width)
{
added = 0;
- if (*p_sbr != NUL)
+ if (*sbr != NUL)
{
if (size + sbrlen + numberwidth > (colnr_T)wp->w_width)
{
@@ -1109,13 +1112,13 @@ win_lbr_chartabsize(
if (width <= 0)
width = (colnr_T)1;
- added += ((size - prev_width) / width) * vim_strsize(p_sbr);
+ added += ((size - prev_width) / width) * vim_strsize(sbr);
if ((size - prev_width) % width)
// wrapped, add another length of 'sbr'
- added += vim_strsize(p_sbr);
+ added += vim_strsize(sbr);
}
else
- added += vim_strsize(p_sbr);
+ added += vim_strsize(sbr);
}
if (wp->w_p_bri)
added += get_breakindent_win(wp, line);
@@ -1242,7 +1245,7 @@ getvcol(
*/
if ((!wp->w_p_list || lcs_tab1 != NUL)
#ifdef FEAT_LINEBREAK
- && !wp->w_p_lbr && *p_sbr == NUL && !wp->w_p_bri
+ && !wp->w_p_lbr && *get_showbreak_value(wp) == NUL && !wp->w_p_bri
#endif
)
{