[vim/vim] Make Lisp indentation the same as other filetypes (Issue #20427)

Skip to first unread message

rendcrx

unread,
11:17 AM (4 hours ago) 11:17 AM
to vim/vim, Subscribed
rendcrx created an issue (vim/vim#20427)

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.

In multi-line expressions, Lisp source lines avoid indenting the first line, whereas other filetypes indent the first line normally.

Describe the solution you'd like

If this feature is specifically designed for vi-compatibility, shouldn't we check the 'compatible' option?

diff --git a/src/indent.c b/src/indent.c
index 9f19f6e..8dbe862 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1146,7 +1146,7 @@ op_reindent(oparg_T *oap, int (*how)(void))
 
            // Be vi-compatible: For lisp indenting the first line is not
            // indented, unless there is only one line.
-           if (i != oap->line_count - 1 || oap->line_count == 1
+           if (!p_cp || i != oap->line_count - 1 || oap->line_count == 1
                                                     || how != get_lisp_indent)
            {
                l = skipwhite(ml_get_curline());

Describe alternatives you've considered

I think indentation is a core feature, so it should be handled properly within Vim itself.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20427@github.com>

Reply all
Reply to author
Forward
0 new messages