mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 23:48:32 +00:00
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
34a7d82aae
Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user