patch 9.1.2052: Compile error when disabling linebreak feature

Problem:  Compile error when disabling linebreak feature
Solution: Adjust ifdefs (Matthias Rader)

When compiling with all features except for linebreak, there were some
compiler errors. By slightly modifying some preprocessor conditions,
compiling without the linebreak feature should work as expected.

closes: #19068

Signed-off-by: Matthias Rader <matthias.rader@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Matthias Rader
2026-01-06 09:58:04 +00:00
committed by Christian Brabandt
parent 679c2c01fa
commit a5b19603e4
5 changed files with 18 additions and 5 deletions
+9 -4
View File
@@ -773,7 +773,7 @@ chartabsize(char_u *p, colnr_T col)
RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col)
}
#if defined(FEAT_LINEBREAK)
#if defined(FEAT_LINEBREAK) || defined(FEAT_PROP_POPUP)
int
win_chartabsize(win_T *wp, char_u *p, colnr_T col)
{
@@ -1226,11 +1226,11 @@ win_lbr_chartabsize(
win_T *wp = cts->cts_win;
#if defined(FEAT_PROP_POPUP) || defined(FEAT_LINEBREAK)
char_u *line = cts->cts_line; // start of the line
int size;
#endif
char_u *s = cts->cts_ptr;
colnr_T vcol = cts->cts_vcol;
#ifdef FEAT_LINEBREAK
int size;
int mb_added = 0;
int n;
char_u *sbr;
@@ -1269,20 +1269,23 @@ win_lbr_chartabsize(
* First get the normal size, without 'linebreak' or text properties
*/
size = win_chartabsize(wp, s, vcol);
# ifdef FEAT_LINEBREAK
if (*s == NUL)
{
// 1 cell for EOL list char (if present), as opposed to the two cell ^@
// for a NUL character in the text.
size = has_lcs_eol ? 1 : 0;
}
# ifdef FEAT_LINEBREAK
int is_doublewidth = has_mbyte && size == 2 && MB_BYTE2LEN(*s) > 1;
# endif
# ifdef FEAT_PROP_POPUP
if (cts->cts_has_prop_with_text)
{
# ifdef FEAT_LINEBREAK
int tab_size = size;
# endif
int charlen = *s == NUL ? 1 : mb_ptr2len(s);
int i;
int col = (int)(s - line);
@@ -1338,6 +1341,7 @@ win_lbr_chartabsize(
else
size += cells;
cts->cts_start_incl = tp->tp_flags & TP_FLAG_START_INCL;
# ifdef FEAT_LINEBREAK
if (*s == TAB)
{
// tab size changes because of the inserted text
@@ -1345,6 +1349,7 @@ win_lbr_chartabsize(
tab_size = win_chartabsize(wp, s, vcol + size);
size += tab_size;
}
# endif
if (tp->tp_col == MAXCOL && (tp->tp_flags
& (TP_FLAG_ALIGN_ABOVE | TP_FLAG_ALIGN_BELOW)))
// count extra line for property above/below
@@ -1520,8 +1525,8 @@ win_lbr_chartabsize(
# ifdef FEAT_PROP_POPUP
size += cts->cts_first_char;
# endif
return size;
# endif
return size;
#endif
}
+3 -1
View File
@@ -1755,7 +1755,7 @@ win_line(
}
#endif
#if defined(FEAT_LINEBREAK) || defined(FEAT_PROP_POPUP)
#if defined(FEAT_LINEBREAK) && defined(FEAT_PROP_POPUP)
colnr_T vcol_first_char = 0;
if (wp->w_p_lbr && number_only == 0)
{
@@ -2775,7 +2775,9 @@ win_line(
}
wlv.extra_for_textprop = FALSE;
# ifdef FEAT_LINEBREAK
in_linebreak = FALSE;
# endif
}
#endif
}
+2
View File
@@ -4035,6 +4035,7 @@ did_set_signcolumn(optset_T *args)
{
char_u **varp = (char_u **)args->os_varp;
#if defined(FEAT_LINEBREAK)
if (check_opt_strings(*varp, p_scl_values, FALSE) != OK)
return e_invalid_argument;
// When changing the 'signcolumn' to or from 'number', recompute the
@@ -4043,6 +4044,7 @@ did_set_signcolumn(optset_T *args)
|| (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) =='u'))
&& (curwin->w_p_nu || curwin->w_p_rnu))
curwin->w_nrwidth_line_count = 0;
#endif
return NULL;
}
+2
View File
@@ -1159,6 +1159,7 @@ sign_list_by_name(char_u *name)
static void
may_force_numberwidth_recompute(buf_T *buf, int unplace)
{
# if defined(FEAT_LINEBREAK)
tabpage_T *tp = NULL;
win_T *wp = NULL;
@@ -1169,6 +1170,7 @@ may_force_numberwidth_recompute(buf_T *buf, int unplace)
(*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u'))
wp->w_nrwidth_line_count = 0;
}
# endif
}
/*
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2052,
/**/
2051,
/**/