]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2052: Compile error when disabling linebreak feature v9.1.2052
authorMatthias Rader <matthias.rader@outlook.com>
Tue, 6 Jan 2026 09:58:04 +0000 (09:58 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 6 Jan 2026 09:58:04 +0000 (09:58 +0000)
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>
src/charset.c
src/drawline.c
src/optionstr.c
src/sign.c
src/version.c

index 829ad37201811d7689b6231e96bbe89634559f1c..74c5913eed5a0cb0b9ef12054f420f9bd281a107 100644 (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
 }
 
index 5ad45c6c3c4fb1e2bc0323d3aa3bdfe115abd20a..59d725d2add5f84346d290a97fd5e48596c9d5a5 100644 (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
        }
index 84f9734428dd4009fdfe99f00dd9e3640aab7fda..153d2baa3f5282033093f0fe39b8b51ccb1c78d0 100644 (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;
 }
index 550bb25af5bb52ebbd421bfab5af87f6c0bcf102..c90856812ae0d26f1f9c36089c481552f4bed976 100644 (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
 }
 
 /*
index ce0ef75de1c25b4e80b14778f6d69b85fb475660..f904ac16d85507edc0b6cded86c8c143ca7cbf93 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2052,
 /**/
     2051,
 /**/