Shougo / defx.nvim

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

defx#do_action('drop') or defx#do_action('drop', 'split') sometimes make vim stucked #190

Closed Freed-Wu closed 4 years ago

Freed-Wu commented 4 years ago

e.g. e

gvim will get stucked util be forced to quit.

e

this is vimrc.

set nocompatible
set runtimepath+=$GITHUBWORKSPACE/roxma/nvim-yarp
set runtimepath+=$GITHUBWORKSPACE/roxma/vim-hug-neovim-rpc
set runtimepath+=$GITHUBWORKSPACE/Shougo/defx.nvim
set runtimepath+=$GITHUBWORKSPACE/mhinz/vim-signify
set runtimepath+=$GITHUBWORKSPACE/Yggdroot/LeaderF
autocmd FileType defx nnoremap <buffer><expr> go
            \ defx#do_action('drop')
autocmd FileType defx nnoremap <buffer><expr> gi
            \ defx#do_action('drop', 'split')

OS: gentoo/Linux vim: gvim8.2

this error never appear in windows OS 10. there exists other circumustances to encouter this error. and defx#do_action('multi', [['drop', 'split'], 'quit']) will not trigger this error. cheers.

Shougo commented 4 years ago
set runtimepath+=$GITHUBWORKSPACE/mhinz/vim-signify
set runtimepath+=$GITHUBWORKSPACE/Yggdroot/LeaderF

They are needed to reproduce? I need real minimal vimrc.

Shougo commented 4 years ago

And please upload the reproduce instructions. If not, I need to close the issue.

Note: I need 100% reproduce-able instructions. I don't need sometimes reproduce-able instructions. I can only fix reproduce-able problems.

Shougo commented 4 years ago

And have you tested the vimrc in the screenshot? I have tested it and not highlights.

Shougo commented 4 years ago

I have tested it in Vim8 and it is not reproduced for me. If you don't reply, I will close the issue.

Freed-Wu commented 4 years ago

syntax highlight is because /etc/vim/vimrc(the default system vimrc). I copy one line from system vimrc to test vimrc then delete the system vimrc. (in gif, i :scriptnames to display /etc/vim/vimrc have not be sourced.)

set nocompatible
filetype plugin on
set runtimepath+=$GITHUBWORKSPACE/roxma/nvim-yarp
set runtimepath+=$GITHUBWORKSPACE/roxma/vim-hug-neovim-rpc
set runtimepath+=$GITHUBWORKSPACE/Shougo/defx.nvim
set runtimepath+=$GITHUBWORKSPACE/mhinz/vim-signify
set runtimepath+=$GITHUBWORKSPACE/Yggdroot/LeaderF
autocmd FileType defx nnoremap <buffer><expr> go
            \ defx#do_action('drop')
autocmd FileType defx nnoremap <buffer><expr> gi
            \ defx#do_action('drop', 'split')

before test, I

cd /home/wzy/.config/nvim
mv init.vim init.vim.bak
touch init.vim
touch empty.txt

that edit init.vim as example.

and need

cd /home/wzy/.vim
ln -s /home/wzy/.config/nvim/init.vim vimrc

(in gif i cd .vim and ls -al to display it)

my vim is 8.2.0114(i :version to display it)

I use ttyrec and ttygif to record a gif.

open vim, then Defx /home/wzy/.config/nvim, then move cursor at line where init.vim at, press gi to see init.vim its content is as above example. then move cursor to empty.txt, press gi, vim will get stucked. i have to close this terminal by force. the ttyrec stop together.

tty

the error is very strange. at first, i drop some file in defx will get vim stucked. so after backup my init.vim to init.vim.bak, i spend a bit time to delete many lines in my original init.vim to get the minimal vimrc. the map about go is spare but for true i leave it. except go, deleting any line will make the gvim cannot get stucked. especially that two plugins. if you can reproduce this error it will be good. if can not i will try to use defx#do_action('multi', [['drop', 'split'], 'quit']) to replace defx#do_action('drop', 'split') to avoid this error. and this error never appear in Windows OS 10. it confused me.

Shougo commented 4 years ago
set runtimepath+=$GITHUBWORKSPACE/mhinz/vim-signify
set runtimepath+=$GITHUBWORKSPACE/Yggdroot/LeaderF

The plugins are really needed?? Please answer my question.

Freed-Wu commented 4 years ago

yes, and directory /home/wzy/.config/nvim/ must be deposited by git before test. i copy init.vim to other directory without deposition of git, test again will not see exclamatory mark on the left provided by signify, and the error will not appear, too.

2020-02-17 11-52-26 的屏幕截图

and don't load plugin Leaderf will not result in this error. i test. it looks like they all don't have problem, but when they be loaded together, vim get stucked probably.

Shougo commented 4 years ago

OK. I get it. But your instruction is not reproducible for me. I will rewrite your instruction. Please wait.

Shougo commented 4 years ago

I have cloned your configuration repository. https://github.com/Freed-Wu/myInit.vim

cd ~/src/myInit.vim
mv init.vim init.vim.bak
touch init.vim
touch empty.txt

that edit init.vim as example.

cd /src/myInit.vim
rm vimrc
ln -s ~/src/myInit.vim/init.vim vimrc
Shougo commented 4 years ago
set runtimepath+=~/work/defx.nvim
set runtimepath+=~/work/nvim-yarp/
set runtimepath+=~/work/vim-hug-neovim-rpc/
set runtimepath+=~/src/vim-signify
set runtimepath+=~/src/LeaderF

filetype plugin indent on

" Remap leader key to ,
let g:mapleader=','
nnoremap <leader>g :<C-u>Denite grep:. -no-empty<CR>

autocmd FileType defx nnoremap <buffer><expr> go
            \ defx#do_action('drop')
autocmd FileType defx nnoremap <buffer><expr> gi
            \ defx#do_action('drop', 'split')
$ cd /src/myInit.vim
$ vim -Nu ~/test.vimrc
Shougo commented 4 years ago
1. open vim
2. execute :Defx command
3. move cursor at line where init.vim
4. press gi to see init.vim its content is as above example
5. move cursor to defx window by <C-w>w
6. move cursor to empty.txt, press gi
7. vim will get stucked. i have to close this terminal by force. the ttyrec stop together.
Shougo commented 4 years ago

I have created the instructions to reproduce, but it cannot be reproduced for me. So I will close the issue later.

Shougo commented 4 years ago

Please don't use your configuration in /home/wzy/.config/nvim/. It is not reproduce-able for me.

Shougo commented 4 years ago

No response. I will close it later.