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)
{
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;
* 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);
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
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
# ifdef FEAT_PROP_POPUP
size += cts->cts_first_char;
# endif
- return size;
# endif
+ return size;
#endif
}
}
#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)
{
}
wlv.extra_for_textprop = FALSE;
+# ifdef FEAT_LINEBREAK
in_linebreak = FALSE;
+# endif
}
#endif
}
{
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
|| (*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;
}