diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-06-23 06:33:01 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-06-23 06:34:56 +0800 |
commit | a4d7394bc8acba0d67f0e2ad7b5645007e37417a (patch) | |
tree | e93ed3e43c866b2c6a83c4bb7d76fc843d9c3390 /src/nvim/indent.c | |
parent | f0889154954f0069e19d4196e3a902499f355ed0 (diff) | |
download | rneovim-a4d7394bc8acba0d67f0e2ad7b5645007e37417a.tar.gz rneovim-a4d7394bc8acba0d67f0e2ad7b5645007e37417a.tar.bz2 rneovim-a4d7394bc8acba0d67f0e2ad7b5645007e37417a.zip |
vim-patch:8.2.5151: reading beyond the end of the line with lisp indenting
Problem: Reading beyond the end of the line with lisp indenting.
Solution: Avoid going over the NUL at the end of the line.
https://github.com/vim/vim/commit/8eba2bd291b347e3008aa9e565652d51ad638cfa
Diffstat (limited to 'src/nvim/indent.c')
-rw-r--r-- | src/nvim/indent.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/indent.c b/src/nvim/indent.c index 010d2fe869..d71b3adb5c 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -697,8 +697,10 @@ int get_lisp_indent(void) && lisp_match(that + 1)) { amount += 2; } else { - that++; - amount++; + if (*that != NUL) { + that++; + amount++; + } firsttry = amount; while (ascii_iswhite(*that)) { |