indentLine icon indicating copy to clipboard operation
indentLine copied to clipboard

IndentLinesDisable not work in defx

Open amikai opened this issue 6 years ago • 7 comments

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']

amikai avatar Aug 22 '19 00:08 amikai

Have you tried https://github.com/Yggdroot/indentLine/blob/47648734706fb2cd0e4d4350f12157d1e5f4c465/doc/indentLine.txt#L108-L121 ?

Yggdroot avatar Aug 23 '19 02:08 Yggdroot

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

amikai avatar Aug 23 '19 06:08 amikai

Please remove indentLine and have a try, the issue still exists. I think this issue is not related to indentLine.

Yggdroot avatar Aug 27 '19 04:08 Yggdroot

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:

image

Subsequent times everyting was fine:

image

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

richin13 avatar Oct 14 '19 02:10 richin13

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 = ''

mopp avatar Jan 25 '20 18:01 mopp

let g:indentLine_fileType = ['typescript', 'javascript', 'javascript.jsx', 'typescript.tsx']

setting filetype you want to use indentLine

PLDaily avatar May 20 '20 06:05 PLDaily

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

SlyBouhafs avatar Jun 27 '20 00:06 SlyBouhafs