Custom action doesn't work with choose_action
orokasan opened this issue · comments
Takumi Kuriki commented
Warning: I will close the issue without the minimal init.vim and the reproduction instructions.
Problems summary
Custom action seems not to work correctly with new choose_action (ref #823.)
Expected
see below.
Environment Information (Required!)
-
denite version (SHA1): 50a2abf
-
OS: Windows 10
-
Vim/neovim version: NVIM v0.5.0-dev+1037-gd6d4e3d1a
-
:checkhealth
or:CheckHealth
result(neovim only):
health#nvim#check
========================================================================
## Configuration
- OK: no issues found
## Performance
- OK: Build type: RelWithDebInfo
## Remote Plugins
- OK: Up to date
health#provider#check
========================================================================
## Clipboard (optional)
- OK: Clipboard tool found: win32yank
## Python 2 provider (optional)
- WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
- ERROR: Python provider error:
- ADVICE:
- provider/pythonx: Could not load Python 2:
python2 not found in search path or not executable.
python2.7 not found in search path or not executable.
python2.6 not found in search path or not executable.
C:\Python38\python.EXE is Python 3.8 and cannot provide Python 2.
- INFO: Executable: Not found
## Python 3 provider (optional)
- INFO: `g:python3_host_prog` is not set. Searching for python in the environment.
- INFO: Multiple python executables found. Set `g:python3_host_prog` to avoid surprises.
- INFO: Executable: C:\Python38\python.EXE
- INFO: Other python executable: C:/Python38/python
- INFO: Python version: 3.8.2
- INFO: pynvim version: 0.4.2
- OK: Latest pynvim is installed.
## Python virtualenv
- OK: no $VIRTUAL_ENV
## Ruby provider (optional)
- WARNING: `ruby` and `gem` must be in $PATH.
- ADVICE:
- Install Ruby and verify that `ruby` and `gem` commands work.
## Node.js provider (optional)
- INFO: Node.js: v14.3.0
- WARNING: Missing "neovim" npm (or yarn) package.
- ADVICE:
- Run in shell: npm install -g neovim
- Run in shell (if you use yarn): yarn global add neovim
## Perl provider (optional)
- WARNING: No usable perl executable found
health#denite#check
========================================================================
## denite.nvim
- OK: has("python3") was successful
- OK: Python 3.6.1+ was successful
- OK: Require msgpack 1.0.0+ was successful
Provide a minimal init.vim with less than 50 lines (Required!)
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/denite.nvim
" any custom action
" this action is copy-pasted from denite.txt
function! s:candidate_file_rec(context)
let path = a:context['targets'][0]['action__path']
let narrow_dir = denite#util#path2directory(path)
let sources_queue = a:context['sources_queue'] + [[
\ {'name': 'file/rec', 'args': [narrow_dir]},
\ ]]
return {'sources_queue': sources_queue}
endfunction
call denite#custom#action('buffer,directory,file,openable',
\ 'candidate_file_rec', function('s:candidate_file_rec'))
autocmd FileType denite call s:denite_my_settings()
function! s:denite_my_settings() abort
nnoremap <silent><buffer><expr> <CR>
\ denite#do_map('do_action')
nnoremap <silent><buffer><expr> <Tab>
\ denite#do_map('choose_action')
" it works correctly
nnoremap <silent><buffer><expr> <C-r>
\ denite#do_map('do_action', 'candidate_file_rec')
endfunction
How to reproduce problems from neovim startup (Required!)
- :Denite file
<TAB>
- select 'candidate_file_rec' and hit
<CR>
- doesn't enter file/rec source and back to previous file source.
Additionally, default action by<CR>
also doesn't work in file source after that.
Shougo commented
Fixed.
Takumi Kuriki commented
Thanks!