mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
vim-patch:8.2.4951: smart indenting done when not enabled
Problem: Smart indenting done when not enabled.
Solution: Check option values before setting can_si. (closes vim/vim#10420)
de5cf28781
This commit is contained in:
@@ -1396,7 +1396,7 @@ static void insert_do_complete(InsertState *s)
|
||||
compl_cont_status = 0;
|
||||
}
|
||||
compl_busy = false;
|
||||
can_si = true; // allow smartindenting
|
||||
can_si = may_do_si(); // allow smartindenting
|
||||
}
|
||||
|
||||
static void insert_do_cindent(InsertState *s)
|
||||
@@ -9403,7 +9403,7 @@ static void ins_try_si(int c)
|
||||
/*
|
||||
* set indent of '#' always to 0
|
||||
*/
|
||||
if (curwin->w_cursor.col > 0 && can_si && c == '#') {
|
||||
if (curwin->w_cursor.col > 0 && can_si && c == '#' && inindent(0)) {
|
||||
// remember current indent for next line
|
||||
old_indent = get_indent();
|
||||
(void)set_indent(0, SIN_CHANGED);
|
||||
|
Reference in New Issue
Block a user