]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.5122: lisp indenting my run over the end of the line v8.2.5122
authorBram Moolenaar <Bram@vim.org>
Sat, 18 Jun 2022 11:51:11 +0000 (12:51 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 18 Jun 2022 11:51:11 +0000 (12:51 +0100)
Problem:    Lisp indenting my run over the end of the line.
Solution:   Check for NUL earlier.

src/indent.c
src/testdir/test_indent.vim
src/version.c

index 794fa2c3430bcba8a499364fb3c1af0108b02e44..fa177bcf2c791eeeb8b154727f871a12947301ab 100644 (file)
@@ -2029,6 +2029,8 @@ get_lisp_indent(void)
                            }
                        }
                    }
+                   if (*that == NUL)
+                       break;
                }
                if (*that == '(' || *that == '[')
                    ++parencount;
index be55227bd20cb2c3ec24302e7049bce30bd46aab..3b5b643177b4e0d056a077f918b8f3892069dd9b 100644 (file)
@@ -144,6 +144,16 @@ func Test_lisp_indent()
   close!
 endfunc
 
+func Test_lisp_indent_quoted()
+  " This was going past the end of the line
+  new
+  setlocal lisp autoindent
+  call setline(1, ['"[', '='])
+  normal Gvk=
+
+  bwipe!
+endfunc
+
 " Test for setting the 'indentexpr' from a modeline
 func Test_modeline_indent_expr()
   let modeline = &modeline
index 89e1fa1b7aff848f5e21fcb39aad12ee4cfd9016..5411e1c189f3e6239b5bc3b762bbd6a9af3f0319 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    5122,
 /**/
     5121,
 /**/