From 49846fb1a31de99f49d6a7e70efe685197423c84 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 15 Oct 2022 16:05:33 +0100 Subject: patch 9.0.0761: cannot use 'indentexpr' for Lisp indenting Problem: Cannot use 'indentexpr' for Lisp indenting. Solution: Add the 'lispoptions' option. --- src/change.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/change.c') diff --git a/src/change.c b/src/change.c index c409acdadd..f036a3767c 100644 --- 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) -- cgit v1.2.3