kristijanhusak / neovim-config

Neovim configuration
254 stars 39 forks source link

call <sid>defx_open with find_current_file winwidth parameter seems not work #7

Closed roachsinai closed 4 years ago

roachsinai commented 4 years ago

I found your config about defx.vim, it helps a lot! Thanks!! But I get a problem with defx_open and find_current_file.

https://github.com/kristijanhusak/neovim-config/blob/aa8a2d4fab4d7eea0efa0572c5b336781320dc17/nvim/partials/defx.vim#L7 https://github.com/kristijanhusak/neovim-config/blob/aa8a2d4fab4d7eea0efa0572c5b336781320dc17/nvim/partials/defx.vim#L8

If I first press n then press n again to hide defx, then press hf, everything is great.

image

As above defx found the file tt.cpp, and I have resize the winwidth it works.

But if I press hf directly after run Vim, got lots of trailing spaces, and winwidth is not as what I set.

image

It hides the buffer of file tt.cpp.

The RED blocks is highlight of trailing spaces.

kristijanhusak commented 4 years ago

how do you open vim, by opening that file, or you open it without providing any file? I'm using neovim, not sure if you use it also or vim.

roachsinai commented 4 years ago

Yeah, I use Vim open that file.

kristijanhusak commented 4 years ago

I'm not sure why that happens. For me in neovim it opens it just fine. Try playing with those options in the defx_open and see why it's like that.

roachsinai commented 4 years ago

So, you just use neovim open a fine, and directly press <Leader>hf to toggle defx and find that file?

kristijanhusak commented 4 years ago

yeah, without any issues. Can you post me two fullscreen screenshots to see the difference between working and non-working?

roachsinai commented 4 years ago

Hi, I so sorry maybe there is something wrong in my vimrc. Cause I've removed all my vimrc then paste your defx.vim into it, then no bugs. I'll check it.

roachsinai commented 4 years ago

<leader>n, which works screenshot:

image

<leader>hf, which not work screenshot:

image

first <leader>hf, then <leader>n to close defx, leaves an new unnamed buffer.

image

roachsinai commented 4 years ago

I can't find it...

I have resize the winwidth.

kristijanhusak commented 4 years ago

If you can, try with neovim and see if it happens. If it doesn't, than it's issue with vim.

roachsinai commented 4 years ago

Found it, it was cause by let g:indent_guides_enable_on_vim_startup=1. Auto start setting for vim-indent-guides plugin.

roachsinai commented 4 years ago

If I comment that variable, everything is OK. So maybe something wierd happened.

kristijanhusak commented 4 years ago

Great! I'm not using indent guides, that's why it's not happening to me.

kristijanhusak commented 4 years ago

Maybe initialize indent guides manually after defx is opened.

roachsinai commented 4 years ago

Yeah, then the trigger of hf still works well.

roachsinai commented 4 years ago

By the way, did you try open defx under a pyenv virtual environment? GOT ERROR!!!

[defx] [yarp] [defx] job is dead. failed establishing channel for ['python3', '-u', '/home/roach/.vim/plugged/nvim-yarp/pythonx/yarp.py'
, '/tmp/vQT9JgM/8', 2, 'defx']
[defx] function defx#util#call_defx[2]..defx#start[1]..defx#initialize[1]..defx#init#_initialize[5]..defx#init#_channel[18]..yarp#core#r
equest[1]..yarp#core#wait_channel,第 13 行
roachsinai commented 4 years ago

Problems come one by one, lol. Maybe I should make an issue to defx repo.

kristijanhusak commented 4 years ago

I'm not developing in python, and not using pyenv. This looks like an issue for defx.

roachsinai commented 4 years ago

Ok, thanks for your help!