diff src/change.c @ 30853:40df8a6515f6 v9.0.0761

patch 9.0.0761: cannot use 'indentexpr' for Lisp indenting Commit: https://github.com/vim/vim/commit/49846fb1a31de99f49d6a7e70efe685197423c84 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 15 16:05:33 2022 +0100 patch 9.0.0761: cannot use 'indentexpr' for Lisp indenting Problem: Cannot use 'indentexpr' for Lisp indenting. Solution: Add the 'lispoptions' option.
author Bram Moolenaar <Bram@vim.org>
date Sat, 15 Oct 2022 17:15:04 +0200
parents 942f1b3bc694
children 74e64f3a54ef
line wrap: on
line diff
--- a/src/change.c
+++ b/src/change.c
@@ -2269,20 +2269,23 @@ open_line(
     else
 	vreplace_mode = 0;
 
-    if (!p_paste
-	    && leader == NULL
-	    && curbuf->b_p_lisp
-	    && curbuf->b_p_ai)
+    if (!p_paste)
     {
-	// do lisp indenting
-	fixthisline(get_lisp_indent);
-	ai_col = (colnr_T)getwhitecols_curline();
-    }
-    else if (do_cindent)
-    {
-	// do 'cindent' or 'indentexpr' indenting
-	do_c_expr_indent();
-	ai_col = (colnr_T)getwhitecols_curline();
+	if (leader == NULL
+		&& !use_indentexpr_for_lisp()
+		&& curbuf->b_p_lisp
+		&& curbuf->b_p_ai)
+	{
+	    // do lisp indenting
+	    fixthisline(get_lisp_indent);
+	    ai_col = (colnr_T)getwhitecols_curline();
+	}
+	else if (do_cindent || (curbuf->b_p_ai && use_indentexpr_for_lisp()))
+	{
+	    // do 'cindent' or 'indentexpr' indenting
+	    do_c_expr_indent();
+	    ai_col = (colnr_T)getwhitecols_curline();
+	}
     }
 
     if (vreplace_mode != 0)