Shougo / defx.nvim

:file_folder: The dark powered file explorer implementation for neovim/Vim8
MIT License
1.17k stars 86 forks source link

Why the 2nd level of tree nodes is indent with two spaces? #303

Closed zoumi closed 3 years ago

zoumi commented 3 years ago

Look at the screenshot: Snipaste_2021-07-07_10-31-07

Shougo commented 3 years ago

You have ignored the issue template and you have not uploaded minimal vimrc. We have not ESP skills.

Closing.

Shougo commented 3 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Please read the issue template header. I already have warned.

zoumi commented 3 years ago

@Shougo The extra space is added at https://github.com/Shougo/defx.nvim/blob/master/rplugin/python3/defx/view.py#L767 in the first loop a indent is added to variable_texts and in the second loop: variable_texts.append('') before exec the line 767 the content of variable_texts is [" ",""]

I don't think this is desired.

Shougo commented 3 years ago

I don't think this is desired.

It is desired. The padding is needed. Because if it is not exists, defx cannot align columns.

And why do you ignore my issue template. Please describe it for me. I need to reproduce your problem.

Shougo commented 3 years ago

Ah, I get the problem. I have reproduced.

Shougo commented 3 years ago

I have reproduced the problem with my minimal vimrc. So I can fix it. But it does not mean you don't need to upload minimal vimrc.

Shougo commented 3 years ago

Your fix works with default configuration. But it does not work with the config.

  call defx#custom#column('icon', {
          \ 'directory_icon': '+',
          \ 'opened_icon': '-',
          \ 'root_icon': ' ',
          \ })
Shougo commented 3 years ago

Hm... No magic.

zoumi commented 3 years ago

Sorry for ignoring the issue template. The reason is: If you can't locate the bug at your first glance, I will try to debug it myself. But I'm really sorry for not pasting my defx's config.

call defx#custom#option('_', {
            \ 'winwidth': 30,
            \ 'split': 'vertical',
            \ 'direction': 'botright',
            \ 'show_ignored_files': 0,
            \ 'buffer_name': '',
            \ 'columns' : 'indent:git:filename:type',
            \ 'toggle': 0,
            \ 'resume': 1,
            \ 'root_marker':'@'
            \ })

function! s:my_defx_settings() abort
    setl nonu
    setl norelativenumber
    setl shiftwidth=1
    setl foldmethod=indent
    " Define mappings
    "....
endfunc

autocmd! FileType defx call s:my_defx_settings()
zoumi commented 3 years ago

I didn't use defx-git. But put it in "columns" doesn't matter.

Shougo commented 3 years ago

If you can't locate the bug at your first glance, I will try to debug it myself.

It need to wait your response. I need to investigate the problem ASAP.

Shougo commented 3 years ago

Finally I have fixed the problem!