aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-06 08:26:31 +0800
committerGitHub <noreply@github.com>2025-03-06 08:26:31 +0800
commit9c4f2cde7bef5decb2de98edfae7b5a2e5146cf4 (patch)
tree79f882c2e713d6fb129fe1a4da3c7d1d439f4896 /src
parent1a35eb9b568e1d916cf86dfb27c723e788254923 (diff)
downloadrneovim-9c4f2cde7bef5decb2de98edfae7b5a2e5146cf4.tar.gz
rneovim-9c4f2cde7bef5decb2de98edfae7b5a2e5146cf4.tar.bz2
rneovim-9c4f2cde7bef5decb2de98edfae7b5a2e5146cf4.zip
vim-patch:9.1.1176: wrong indent when expanding multiple lines (#32746)
Problem: wrong indentation of lastline when expanding multiple lines Solution: Check OPENLINE_FORCE_INDENT flag in open_line() (glepnir) closes: vim/vim#16786 https://github.com/vim/vim/commit/34a7d82aaed9836174f4ea84af047db3fdf6c8b3 Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/change.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c
index 84053619d7..acdf131ddb 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -1315,7 +1315,8 @@ bool open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
// May do indenting after opening a new line.
bool do_cindent = !p_paste && (curbuf->b_p_cin || *curbuf->b_p_inde != NUL)
&& in_cinkeys(dir == FORWARD ? KEY_OPEN_FORW : KEY_OPEN_BACK,
- ' ', linewhite(curwin->w_cursor.lnum));
+ ' ', linewhite(curwin->w_cursor.lnum))
+ && !(flags & OPENLINE_FORCE_INDENT);
// Find out if the current line starts with a comment leader.
// This may then be inserted in front of the new line.