diff src/textformat.c @ 28942:6cdf55afaae9 v8.2.4993

patch 8.2.4993: smart/C/lisp indenting is optional Commit: https://github.com/vim/vim/commit/8e145b82464a21ee4fdf7948f04e2a1d505f8bfa Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 21 20:17:31 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Sat, 21 May 2022 21:30:04 +0200
parents d0241e74bfdb
children 864fa5276e78
line wrap: on
line diff
--- a/src/textformat.c
+++ b/src/textformat.c
@@ -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);