Skip to content

Commit a5b1960

Browse files
matrdrchrisbra
authored andcommitted
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>
1 parent 679c2c0 commit a5b1960

5 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/charset.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ chartabsize(char_u *p, colnr_T col)
773773
RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col)
774774
}
775775

776-
#if defined(FEAT_LINEBREAK)
776+
#if defined(FEAT_LINEBREAK) || defined(FEAT_PROP_POPUP)
777777
int
778778
win_chartabsize(win_T *wp, char_u *p, colnr_T col)
779779
{
@@ -1226,11 +1226,11 @@ win_lbr_chartabsize(
12261226
win_T *wp = cts->cts_win;
12271227
#if defined(FEAT_PROP_POPUP) || defined(FEAT_LINEBREAK)
12281228
char_u *line = cts->cts_line; // start of the line
1229+
int size;
12291230
#endif
12301231
char_u *s = cts->cts_ptr;
12311232
colnr_T vcol = cts->cts_vcol;
12321233
#ifdef FEAT_LINEBREAK
1233-
int size;
12341234
int mb_added = 0;
12351235
int n;
12361236
char_u *sbr;
@@ -1269,20 +1269,23 @@ win_lbr_chartabsize(
12691269
* First get the normal size, without 'linebreak' or text properties
12701270
*/
12711271
size = win_chartabsize(wp, s, vcol);
1272+
# ifdef FEAT_LINEBREAK
12721273
if (*s == NUL)
12731274
{
12741275
// 1 cell for EOL list char (if present), as opposed to the two cell ^@
12751276
// for a NUL character in the text.
12761277
size = has_lcs_eol ? 1 : 0;
12771278
}
1278-
# ifdef FEAT_LINEBREAK
1279+
12791280
int is_doublewidth = has_mbyte && size == 2 && MB_BYTE2LEN(*s) > 1;
12801281
# endif
12811282

12821283
# ifdef FEAT_PROP_POPUP
12831284
if (cts->cts_has_prop_with_text)
12841285
{
1286+
# ifdef FEAT_LINEBREAK
12851287
int tab_size = size;
1288+
# endif
12861289
int charlen = *s == NUL ? 1 : mb_ptr2len(s);
12871290
int i;
12881291
int col = (int)(s - line);
@@ -1338,13 +1341,15 @@ win_lbr_chartabsize(
13381341
else
13391342
size += cells;
13401343
cts->cts_start_incl = tp->tp_flags & TP_FLAG_START_INCL;
1344+
# ifdef FEAT_LINEBREAK
13411345
if (*s == TAB)
13421346
{
13431347
// tab size changes because of the inserted text
13441348
size -= tab_size;
13451349
tab_size = win_chartabsize(wp, s, vcol + size);
13461350
size += tab_size;
13471351
}
1352+
# endif
13481353
if (tp->tp_col == MAXCOL && (tp->tp_flags
13491354
& (TP_FLAG_ALIGN_ABOVE | TP_FLAG_ALIGN_BELOW)))
13501355
// count extra line for property above/below
@@ -1520,8 +1525,8 @@ win_lbr_chartabsize(
15201525
# ifdef FEAT_PROP_POPUP
15211526
size += cts->cts_first_char;
15221527
# endif
1523-
return size;
15241528
# endif
1529+
return size;
15251530
#endif
15261531
}
15271532

src/drawline.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ win_line(
17551755
}
17561756
#endif
17571757

1758-
#if defined(FEAT_LINEBREAK) || defined(FEAT_PROP_POPUP)
1758+
#if defined(FEAT_LINEBREAK) && defined(FEAT_PROP_POPUP)
17591759
colnr_T vcol_first_char = 0;
17601760
if (wp->w_p_lbr && number_only == 0)
17611761
{
@@ -2775,7 +2775,9 @@ win_line(
27752775
}
27762776

27772777
wlv.extra_for_textprop = FALSE;
2778+
# ifdef FEAT_LINEBREAK
27782779
in_linebreak = FALSE;
2780+
# endif
27792781
}
27802782
#endif
27812783
}

src/optionstr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4035,6 +4035,7 @@ did_set_signcolumn(optset_T *args)
40354035
{
40364036
char_u **varp = (char_u **)args->os_varp;
40374037

4038+
#if defined(FEAT_LINEBREAK)
40384039
if (check_opt_strings(*varp, p_scl_values, FALSE) != OK)
40394040
return e_invalid_argument;
40404041
// When changing the 'signcolumn' to or from 'number', recompute the
@@ -4043,6 +4044,7 @@ did_set_signcolumn(optset_T *args)
40434044
|| (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) =='u'))
40444045
&& (curwin->w_p_nu || curwin->w_p_rnu))
40454046
curwin->w_nrwidth_line_count = 0;
4047+
#endif
40464048

40474049
return NULL;
40484050
}

src/sign.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,7 @@ sign_list_by_name(char_u *name)
11591159
static void
11601160
may_force_numberwidth_recompute(buf_T *buf, int unplace)
11611161
{
1162+
# if defined(FEAT_LINEBREAK)
11621163
tabpage_T *tp = NULL;
11631164
win_T *wp = NULL;
11641165

@@ -1169,6 +1170,7 @@ may_force_numberwidth_recompute(buf_T *buf, int unplace)
11691170
(*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u'))
11701171
wp->w_nrwidth_line_count = 0;
11711172
}
1173+
# endif
11721174
}
11731175

11741176
/*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
2052,
737739
/**/
738740
2051,
739741
/**/

0 commit comments

Comments
 (0)