0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.4993: smart/C/lisp indenting is optional

Problem:    smart/C/lisp indenting is optional, which makes the code more
            complex, while it only reduces the executable size a bit.
Solution:   Graduate FEAT_CINDENT, FEAT_SMARTINDENT and FEAT_LISP.
This commit is contained in:
Bram Moolenaar
2022-05-21 20:17:31 +01:00
parent 5a01caa904
commit 8e145b8246
27 changed files with 80 additions and 508 deletions

View File

@@ -108,7 +108,6 @@ internal_format(
char_u *line = ml_get_curline();
leader_len = get_leader_len(line, NULL, FALSE, TRUE);
#ifdef FEAT_CINDENT
if (leader_len == 0 && curbuf->b_p_cin)
{
int comment_start;
@@ -123,7 +122,6 @@ internal_format(
leader_len += comment_start;
}
}
#endif
}
else
leader_len = 0;
@@ -444,16 +442,12 @@ internal_format(
}
haveto_redraw = TRUE;
#ifdef FEAT_CINDENT
set_can_cindent(TRUE);
#endif
// moved the cursor, don't autoindent or cindent now
did_ai = FALSE;
#ifdef FEAT_SMARTINDENT
did_si = FALSE;
can_si = FALSE;
can_si_back = FALSE;
#endif
line_breakcheck();
}
@@ -1119,14 +1113,10 @@ format_lines(
// indent.
if (curwin->w_cursor.lnum == first_line)
indent = get_indent();
else
# ifdef FEAT_LISP
if (curbuf->b_p_lisp)
else if (curbuf->b_p_lisp)
indent = get_lisp_indent();
else
# endif
{
#ifdef FEAT_CINDENT
if (cindent_on())
{
indent =
@@ -1136,7 +1126,6 @@ format_lines(
get_c_indent();
}
else
#endif
indent = get_indent();
}
(void)set_indent(indent, SIN_CHANGED);