Shougo / denite.nvim

:dragon: Dark powered asynchronous unite all interfaces for Neovim/Vim8
Other
2.06k stars 216 forks source link

raised ValueError in open file #862

Closed osyo-manga closed 3 years ago

osyo-manga commented 3 years ago

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

Problems summary

ValueError is raised when opening a file in a directory with the same name.

Expected

No raised and opend file.

Environment Information (Required!)

Provide a minimal init.vim with less than 50 lines (Required!)

" test_vimrc
scriptencoding utf-8
set nocompatible

" Must options
set autochdir

filetype off
filetype plugin indent off     " required!

set rtp+=~/Dropbox/work/vim/runtime/bundle/neobundle.vim
call neobundle#begin(expand($HOME."/.vim_test/neobundle"))

NeoBundle "roxma/nvim-yarp"
NeoBundle "roxma/vim-hug-neovim-rpc"
NeoBundle "Shougo/denite.nvim"

filetype plugin indent on
call neobundle#end()
syntax enable

" Define mappings
autocmd FileType denite call s:denite_my_settings()
function! s:denite_my_settings() abort
  nnoremap <silent><buffer><expr> <CR>
  \ denite#do_map('do_action')
endfunction

How to reproduce problems from neovim startup (Required!)

  1. Make files
$ tree ./
./
├── sample
│   └── other.txt
├── sample.txt
└── test_vimrc
  1. Open sample/other.txt
    • $ vim -u ./test_vimrc -U NONE sample/other.txt
  2. Run denite-file
    • :Denite file::../
  3. Open sample.txt
  4. Raise ValueError

Generate a logfile if appropriate

:message logs

[denite] Traceback (most recent call last):
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/rplugin.py", line 84, in do_map
[denite]     ret = do_map(ui, args[1], args[2])
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/ui/map.py", line 21, in do_map
[denite]     return MAPPINGS[name](denite, params)
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/ui/map.py", line 74, in _do_action
[denite]     return denite.do_action(name, is_manual=True)
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/ui/default.py", line 104, in do_action
[denite]     self._denite.do_action(self._context, action_name, candidates)
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/parent.py", line 64, in do_action
[denite]     return self._get('do_action', [context, action_name, targets])
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/parent.py", line 85, in _get
[denite]     return self._put(name, args)
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/parent.py", line 81, in _put
[denite]     return self._child.main(name, args, queue_id=0)
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/child.py", line 79, in main
[denite]     ret = self.do_action(args[0], args[1], args[2])
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/child.py", line 261, in do_action
[denite]     new_context = (action['func'](context)
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/kind/openable.py", line 79, in action_tabswitch
[denite]     self._action_switch(context, self.action_tabopen)
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/kind/openable.py", line 96, in _action_switch
[denite]     fallback(context)
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/kind/openable.py", line 71, in action_tabopen
[denite]     self.action_open(new_context)
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/kind/file.py", line 29, in action_open
[denite]     self._open(context, 'silent edit')
[denite]   File "/home/worker/neobundle/denite.nvim/rplugin/python3/denite/kind/file.py", line 163, in _open
[denite]     path = str(Path(path).relative_to(cwd))
[denite]   File "/home/worker/.asdf/installs/python/3.9.2/lib/python3.9/pathlib.py", line 928, in relative_to
[denite]     raise ValueError("{!r} is not in the subpath of {!r}"
[denite] ValueError: '/home/worker/test/sample.txt' is not in the subpath of '/home/worker/test/sample' OR one path is relative and the other is absolute.
[denite] Please execute :messages command.

Screenshot (if possible)

simplescreenrecorder-2021-10-06_21 15 11

Upload the log file

osyo-manga commented 3 years ago

Thanks :)