mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
fix indent-blankline activation bug
When InsertLeave is triggered, we should check if we need to start indent-blankline before enabling it.
This commit is contained in:
parent
bd92419bf9
commit
62b6226520
@ -9,9 +9,15 @@ require("indent_blankline").setup({
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
|
function! Should_activate_indentblankline() abort
|
||||||
|
if index(g:indent_blankline_filetype_exclude, &filetype) == -1
|
||||||
|
IndentBlanklineEnable
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
augroup indent_blankline
|
augroup indent_blankline
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd InsertEnter * IndentBlanklineDisable
|
autocmd InsertEnter * IndentBlanklineDisable
|
||||||
autocmd InsertLeave * IndentBlanklineEnable
|
autocmd InsertLeave * call Should_activate_indentblankline()
|
||||||
augroup END
|
augroup END
|
||||||
]])
|
]])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user