indentLine
indentLine copied to clipboard
IndentLinesDisable not work in defx
https://github.com/Shougo/defx.nvim/issues/154 Setting the g:indentLine_fileTypeExclude like following or IndentLinesDisable are not work in defx. The conceallevel and concealcursor are not reseted properly.
let g:indentLine_fileTypeExclude = ['defx']
Have you tried https://github.com/Yggdroot/indentLine/blob/47648734706fb2cd0e4d4350f12157d1e5f4c465/doc/indentLine.txt#L108-L121 ?
I try this, but it isn't work too.
let g:indentLine_fileTypeExclude = ['defx'] " defx filetype is defx
let g:indentLine_bufTypeExclude = ['nofile'] " defx buftype is nofile
let g:indentLine_bufNameExclude = ["\[defx\]*"] " my defx bufname is [defx] -0
Please remove indentLine and have a try, the issue still exists. I think this issue is not related to indentLine.
I'm ran into this issue with indentLine + defx setup and g:indentLine_fileTypeExclude.
Basically, the first time my defx buffer showed up, indentLine'd do this:

Subsequent times everyting was fine:

I explored the plugin's code a little and found the issue:
If condition @ function Filter() currently looks like this:
if s:Filter() && g:indentLine_enabled || exists("b:indentLine_enabled") && b:indentLine_enabled
The problem with defx is that BufWinEnter event is not called when opening a Defx buffer, thus Disable() never gets called, which causes b:indentLine_enabled to be 1.
Re-ordering the if conditions solves the issue. I'll open a PR with the change
hi I also faced this problem, and I can avoid it by this configuration.
let g:indentLine_fileTypeExclude = ['defx']
let g:indentLine_setConceal = 0
let g:indentLine_concealcursor = ''
let g:indentLine_fileType = ['typescript', 'javascript', 'javascript.jsx', 'typescript.tsx']
setting filetype you want to use indentLine
I have the same issue here, it doesn't work with any of the exclude options. I tried this configuration which is supposed to work but i got no luck.
autocmd FileType defx call s:defx_indent_toggle()
function! s:defx_indent_toggle() abort
let g:indentLine_enabled = 0
endfunction