Fuzzy finder UI for ddu.vim
This UI is standard fuzzy finder.
https://github.com/vim-denops/denops.vim
https://github.com/Shougo/ddu.vim
call ddu#custom#patch_global(#{
\ ui: 'ff',
\ })
Fuzzy finder UI for ddu.vim
License: MIT License
Fuzzy finder UI for ddu.vim
This UI is standard fuzzy finder.
https://github.com/vim-denops/denops.vim
https://github.com/Shougo/ddu.vim
call ddu#custom#patch_global(#{
\ ui: 'ff',
\ })
Title says it all.
No error
ba1316e
62b1d22
deno -V
output): deno 1.34.3
:version
output:NVIM v0.10.0-dev-3bf887f
Build type: Release
LuaJIT 2.1.0-beta3
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/share/nvim"
Run :checkhealth for more info
" Your minimal init.vim/vimrc
let g:denops#deno = "~/path/to/deno"
set runtimepath+=~/path/to/denops.vim
set runtimepath+=~/path/to/ddu.vim
set runtimepath+=~/path/to/ddu-ui-ff
set runtimepath+=~/path/to/ddu-source-git
function! DduSourceGit()
cd ~/path/to/ddu.vim
call ddu#start(#{
\ sources: [#{name: "git_log"}],
\ ui: "ff",
\ uiParams: #{
\ ff: #{
\ autoAction: #{ name: "preview" }
\ }
\ },
\ })
endfunction
:call DduSourceGit()
:redir
and :message
(if errored)Error detected while processing function <lambda>59[1]..<SNR>166_do_auto_action[12]..ddu#ui#sync_action[1]..ddu#ui_sync_action[4]..ddu#_request[15]..denops#request[1]..denops#server#request[4]..denops#_internal#server#chan#request[4]..denops#_internal#rpc#nvim#request:
line 1:
Error invoking 'invoke' on channel 4:
0,Vim:E119: Not enough arguments for function: ddu#ui#ff#_open_preview_window
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
SSIA
Correctly updated by moving the cursor.
Latest
ddu-ui-ff version (SHA1):
2fafeda
denops.vim version (SHA1):
3b489d50ba2e034c829a09475a4002176bffbef7
deno version(deno -V
output):
deno 1.34.2
OS: Ubuntu 22.04 (WSL2)
neovim/Vim :version
output:
NVIM v0.10.0-dev-f31dba9
set runtimepath+=/path/to/denops.vim
set runtimepath+=/path/to/ddu.vim
set runtimepath+=/path/to/ddu-ui-ff
set runtimepath+=/path/to/ddu-kind-file
set runtimepath+=/path/to/ddu-source-file_rec
call ddu#custom#patch_global(#{
\ sources: [#{ name: 'file_rec' }],
\ ui: 'ff',
\ uiParams: #{
\ ff: #{
\ startFilter: v:true,
\ autoAction: #{
\ name: 'preview',
\ },
\ },
\ },
\ kindOptions: #{
\ _: #{
\ defaultAction: 'open',
\ },
\ },
\})
augroup my-ddu-ff
autocmd!
autocmd FileType ddu-ff call <SID>ddu_ff_mapping()
autocmd FileType ddu-ff-filter call <SID>ddu_ff_filter_mapping()
augroup END
function! s:ddu_ff_mapping() abort
nnoremap <buffer><silent> <CR>
\ <Cmd>call ddu#ui#do_action('itemAction')<CR>
nnoremap <buffer><silent> <Esc>
\ <Cmd>call ddu#ui#do_action('quit')<CR>
nnoremap <buffer><silent> p
\ <Cmd>call ddu#ui#do_action('preview')<CR>
endfunction
function! s:ddu_ff_filter_mapping() abort
nnoremap <buffer><silent> <Esc>
\ <Cmd>call ddu#ui#do_action('closeFilterWindow')<CR>
endfunction
call ddu#start({})
<Esc>
in normal mode.:redir
and :message
(if errored)Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
<C-j>
hides the prompt.
<C-j>
does not hide the prompt.
ddu-ui-std version (SHA1): f9a5f27
ddu.vim version (SHA1): 8a765f0ab1d1235e51a6853bcc900c4a42134382
denops.vim version (SHA1): e2f17041495123e8ed9baa69098c947c5d7f6358
deno version(deno -V
output): 1.18.2
OS: Mac
neovim/Vim :version
output:
NVIM v0.7.0-dev+1017-g28d5face2
Build type: Release
LuaJIT 2.1.0-beta3
:checkhealth
or :CheckHealth
result(neovim only): OKif &compatible
set nocompatible
endif
let $CACHE = expand('~/.cache')
if !isdirectory(expand($CACHE))
call mkdir(expand($CACHE), 'p')
endif
let s:dein_dir = expand('$CACHE/dein')
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
if &runtimepath !~# '/dein.vim'
if !isdirectory(s:dein_repo_dir)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir
endif
execute 'set runtimepath^=' . s:dein_repo_dir
endif
call dein#begin(s:dein_dir, expand('<sfile>'))
call dein#add('vim-denops/denops.vim')
call dein#add('Shougo/ddu.vim')
call dein#add('Shougo/ddu-commands.vim')
call dein#add('Shougo/ddu-ui-std')
call dein#add('Shougo/ddu-filter-matcher_substring')
call dein#add('Shougo/ddu-source-file_rec')
call dein#add('Shougo/ddu-kind-file')
call dein#end()
call dein#save_state()
call ddu#custom#patch_global({
\ 'ui': 'std',
\ 'sourceOptions': {
\ '_': {
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ 'uiParams': {
\ 'std': {
\ 'split': 'floating',
\ 'prompt': '>'
\ },
\ },
\ })
autocmd FileType ddu-std call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> <CR>
\ <Cmd>call ddu#ui#std#do_action('itemAction')<CR>
nnoremap <buffer><silent> i
\ <Cmd>call ddu#ui#std#do_action('openFilterWindow')<CR>
nnoremap <buffer><silent> q
\ <Cmd>call ddu#ui#std#do_action('quit')<CR>
endfunction
autocmd FileType ddu-std-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer><silent> <CR>
\ <Esc><Cmd>close<CR>
nnoremap <buffer><silent> <CR>
\ <Cmd>close<CR>
endfunction
call dein#update()
commnad.call ddu#start({'sources': [{'name': 'file_rec'}]})
command.i
(Open filter)<C-j>
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
When I use ddu-ui-ff and ddu-ui-filer with different split params, these settings is not work.
For example, when I use ddu-ui-ff with split: floating
and ddu-ui-filer with split:vertical
...
36b08deb8cafb8b6ceb9b677bf425f479fca3ee7
da7d1d5d3c97113c8b10e9fc104f2e312e854999
8f3899de3d3add07105221262dca90a31c4c2d4c
deno -V
output):deno 1.30.3
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
:version
output:NVIM v0.9.0-dev-1088+gd66832c76
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
set rtp+=path/vim-denops/denops.vim
set rtp+=path/Shougo/ddu.vim
set rtp+=path/Shougo/ddu-ui-ff
set rtp+=path/Shougo/ddu-ui-filer
set rtp+=path/Shougo/ddu-source-file
set rtp+=path/Shougo/ddu-source-file_rec
let s:ddu_config_json =<< trim MARK
{
"uiParams": {
"ff": {
"split": "floating"
},
"filer": {
"split": "vertical"
}
}
}
MARK
let s:ddu_config_json = s:ddu_config_json->join('')->json_decode()
call ddu#custom#patch_global(s:ddu_config_json)
nnoremap [ddu] <Nop>
nmap <Space>u [ddu]
nmap <silent> [ddu]f <Cmd>call ddu#start({
\ 'ui': 'ff',
\ 'sources': [{'name': 'file_rec', 'params': {}}],
\ })<CR>
nmap <silent> [ddu]e <Cmd>call ddu#start({
\ 'ui': 'filer',
\ 'sources': [{'name': 'file', 'params': {}}],
\ })<CR>
<Space>
u
f
<Space>
u
e
keeping the ff floating window<Space>
u
e
<Space>
u
f
keeping the filer vertical windowff | filer |
---|---|
filer | ff |
---|---|
:redir
and :message
(if errored)Thank you for great plugin!
When I open ddu-std-ui
with split: floating
option by call file_rec
source and call ddu#ui#std#do_action('quit')
but floating ui window does not close.
It seems to be closed but ui window immediately repoen.
This problem may be caused by source with long processing time. (such as file_rec in ~
)
Minimal vimrc is the following.
set rtp+=~/.cache/dein/repos/github.com/vim-denops/denops.vim
set rtp+=~/.cache/dein/repos/github.com/Shougo/ddu-ui-std
set rtp+=~/.cache/dein/repos/github.com/Shougo/ddu-source-file_rec
set rtp+=~/.cache/dein/repos/github.com/Shougo/ddu-filter-matcher_substring
set rtp+=~/.cache/dein/repos/github.com/Shougo/ddu.vim
call ddu#custom#patch_global({
\ 'ui': 'std',
\ })
call ddu#custom#patch_global({
\ 'sourceOptions': {
\ '_': {
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ 'uiParams': {
\ 'std': {
\ 'split': 'floating',
\ },
\ },
\ })
call ddu#custom#patch_global({
\ 'sources': [
\ {'name': 'file_rec', 'params': {}},
\ ],
\ })
nnoremap \F <Cmd>call ddu#start({'name': 'file_rec', 'params': {}})<CR>
autocmd FileType ddu-std call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> q <Cmd>call ddu#ui#std#do_action('quit')<CR>
endfunction
" move to home directory so that file_rec will take more time
cd
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
When I execute itemAction in the ddu buffer, I get an error.
The file is opened when itemAction is executed.
ddu-ui-std version (SHA1):47bbb8801d93698401bde4d9ac1409ab04f3809c
ddu.vim version (SHA1):8e21a4a41ead8d1531051483f248209b19f5501a
denops.vim version (SHA1):333aa1783352c346cc4fbaa43217bbc1c07ddbaa
deno version(deno -V
output):1.18.1
OS:Mac
neovim/Vim :version
output:v0.7.0-dev+956-g6cb670cb2
:checkhealth
or :CheckHealth
result(neovim only):OK
if &compatible
set nocompatible
endif
let $CACHE = expand('~/.cache')
if !isdirectory(expand($CACHE))
call mkdir(expand($CACHE), 'p')
endif
let s:dein_dir = expand('$CACHE/dein')
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
if &runtimepath !~# '/dein.vim'
if !isdirectory(s:dein_repo_dir)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir
endif
execute 'set runtimepath^=' . s:dein_repo_dir
endif
call dein#begin(s:dein_dir, expand('<sfile>'))
call dein#add('vim-denops/denops.vim')
call dein#add('Shougo/ddu.vim')
call dein#add('Shougo/ddu-commands.vim')
call dein#add('Shougo/ddu-ui-std')
call dein#add('Shougo/ddu-filter-matcher_substring')
call dein#add('Shougo/ddu-source-file_rec')
call dein#end()
call dein#save_state()
call ddu#custom#patch_global({
\ 'ui': 'std',
\ 'sourceOptions': {
\ '_': {
\ 'ignoreCase': v:true,
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ })
autocmd FileType ddu-std call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> <CR>
\ <Cmd>call ddu#ui#std#do_action('itemAction')<CR>
nnoremap <buffer><silent> i
\ <Cmd>call ddu#ui#std#do_action('openFilterWindow')<CR>
nnoremap <buffer><silent> q
\ <Cmd>call ddu#ui#std#do_action('quit')<CR>
endfunction
autocmd FileType ddu-std-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer><silent> <CR>
\ <Esc><Cmd>close<CR>
nnoremap <buffer><silent> <CR>
\ <Cmd>close<CR>
endfunction
call dein#update()
command.Ddu -name=search file_rec -ui-param-startFilter=v:true
command.It would be great to have a fast dial option to select lines in the ui, like -quick-match in unite.
I read all docs of ddu and ddu-ui-ff, but I still can't configure ff ui. I have tried:
call ddu#custom#patch_global({'uiParams': {'prompt': '> '}})
But it doesn't work. Could you give a simple example?
Thank you for great plugin.
ddu-ff buffer lose cursor focus after closing filter window.
This issue occurs from latest commit d7fbe6c.
call plug#begin(expand('~/.vim/plugged'))
Plug 'vim-denops/denops.vim'
Plug 'Shougo/ddu.vim'
Plug 'Shougo/ddu-ui-ff'
Plug 'Shougo/ddu-source-file_rec'
Plug 'Shougo/ddu-kind-file'
Plug 'yuki-yano/ddu-filter-fzf'
Plug 'matsui54/ddu-source-file_external'
call plug#end()
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'sources': [
\ {'name': 'file_external',
\ 'params':
\ {
\ 'cmd': ['rg', '--files', '--hidden', '--glob', '!.git', '--color', 'never']
\ }
\ }
\ ],
\ 'sourceOptions': {
\ '_': {
\ 'matchers': ['matcher_fzf'],
\ },
\ }
\ })
autocmd FileType ddu-ff call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> <CR>
\ <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
nnoremap <buffer><silent> i
\ <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
nnoremap <buffer><silent> q
\ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer><silent> <CR>
\ <Esc><Cmd>close<CR>
nnoremap <buffer><silent> <CR>
\ <Cmd>close<CR>
nnoremap <buffer><silent> q
\ <Cmd>close<CR>
endfunction
nmap <silent><c-p> :call ddu#start({})<CR>
After insert any word and close filter window by enter key, cursor don't move to the ddu-ff buffer but buffer of current opening file.
If this is expected, could you tell me the way to focus the ddu-ff buffer?
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
AutoAction is not fied when moving cursor by cursorNext/cursorPrevious in ddu-ff-filter.
AutoAction is fired.
Latest
ddu-ui-ff version (SHA1):
2fafeda
denops.vim version (SHA1):
3b489d50ba2e034c829a09475a4002176bffbef7
deno version(deno -V
output):
deno 1.34.2
OS: Ubuntu 22.04 (WSL2)
neovim/Vim :version
output:
NVIM v0.10.0-dev-f31dba9
set runtimepath+=/path/to/denops.vim
set runtimepath+=/path/to/ddu.vim
set runtimepath+=/path/to/ddu-ui-ff
set runtimepath+=/path/to/ddu-kind-file
set runtimepath+=/path/to/ddu-source-file_rec
call ddu#custom#patch_global(#{
\ sources: [#{ name: 'file_rec' }],
\ ui: 'ff',
\ uiParams: #{
\ ff: #{
\ autoAction: #{
\ name: 'preview',
\ },
\ },
\ },
\ kindOptions: #{
\ _: #{
\ defaultAction: 'open',
\ },
\ },
\})
augroup my-ddu-ff
autocmd!
autocmd FileType ddu-ff call <SID>ddu_ff_mapping()
autocmd FileType ddu-ff-filter call <SID>ddu_ff_filter_mapping()
augroup END
function! s:ddu_ff_mapping() abort
nnoremap <buffer><silent> <CR>
\ <Cmd>call ddu#ui#do_action('itemAction')<CR>
nnoremap <buffer><silent> <Esc>
\ <Cmd>call ddu#ui#do_action('quit')<CR>
nnoremap <buffer><silent> i
\ <Cmd>call ddu#ui#do_action('openFilterWindow')<CR>
endfunction
function! s:ddu_ff_filter_mapping() abort
nnoremap <buffer><silent> <Esc>
\ <Cmd>call ddu#ui#do_action('closeFilterWindow')<CR>
nnoremap <buffer><silent> <C-n>
\ <Cmd>call ddu#ui#do_action('cursorNext')<CR>
nnoremap <buffer><silent> <C-p>
\ <Cmd>call ddu#ui#do_action('cursorPrevious')<CR>
endfunction
set cursorline
call ddu#start({})
i
.<C-n>
/<C-p>
in ddu-ff-filter (normal mode).:redir
and :message
(if errored)Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
Open the ddu ,open filter window then close the ddu with ddu#ui#ff#do_action('quit')
in insert mode, and the mode is INSERT not NORMAL.
After the above situation, the mode is NORMAL.
Or when ddu#start({})
in INSERT mode, the mode is INSERT. when ddu#start({})
in NORMAL mode , the mode is NORMAL.
deno -V
output)::version
output:set rtp+=~/.cache/dein/nvim/repos/github.com/vim-denops/denops.vim
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu.vim
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-ui-ff
nnoremap [ddu] <Nop>
nmap <Space>u [ddu]
nmap <silent> [ddu]f <Cmd>call ddu#start({ 'ui': 'ff' })<CR>
autocmd FileType ddu-ff call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> i
\ <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
endfunction
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer> <C-q>
\ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction
<Space>
u
f
i
for open filter window.<C-q>
in filter window in INSERT mode for quit ddu.:redir
and :message
(if errored)When using ddu-ui-ff to display a filter window, the window division is not fixed and the window width changes repeatedly.
Filter windows is fixed.
ddu.vim version (SHA1):
990b0c6d14a6be27682be73fdc3d9a835d62f765
denops.vim version (SHA1):
a104cbff7e47a63978cfb3921da4333465fc6d15
deno version(deno -V
output):
1.22.2
OS: Windows11
neovim/Vim :version
output:
GVim 8.2
patch 1-3438
if &compatible
set nocompatible " Be iMproved
endif
if empty(glob('/path/to/vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall | source $MYVIMRC
endif
call plug#begin('/path/to/vim/plugged')
Plug 'vim-denops/denops.vim'
Plug 'Shougo/ddu.vim'
Plug 'Shougo/ddu-ui-ff'
Plug 'Shougo/ddu-filter-matcher_substring'
Plug 'Shougo/ddu-kind-file'
Plug 'Shougo/ddu-ui-filer'
Plug 'Shougo/ddu-commands.vim'
call plug#end()
" ddu
" Specify matcher.
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'sourceOptions' : {
\ '_' : {
\ 'ignoreCase': v:true,
\ },
\ },
\ })
nnoremap <silent> <space><space> <Cmd>Ddu
\ -name=search mr -ui-param-startFilter=v:true<CR>
There are times when I want to disable the preview display while using ddu with a preview set in autoAction
. Even if the preview is closed once, if it is set in autoAction
, the preview will be redisplayed when moving the cursor.
I would like a function that can cancel the specified autoAction in that ddu session. Also, when this function is supported, it is desirable that the preview in autoAction
is enabled again in the next launch of ddu, but should this be handled with something like autocmd?
Filter windows are created every time items are enqueued.
Neovim v0.7.0
set runtimepath+=~/.cache/dein/repos/github.com/vim-denops/denops.vim
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu.vim
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu-ui-ff
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu-kind-file
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu-source-file_rec
nnoremap <Space>f
\ <Cmd>call ddu#start({'sources': [{'name': 'file_rec'}]})<CR>
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'uiParams': {'ff': {
\ 'split': 'floating',
\ 'autoResize': v:true,
\ }},
\ })
autocmd FileType ddu-ff call s:ddu_ff_my_settings()
function! s:ddu_ff_my_settings() abort
nnoremap <buffer> i
\ <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
nnoremap <buffer> q
\ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer> <CR> <Esc><Cmd>close<CR>
endfunction
<Space>f
(start ddu)i
(open filter window) immediately after the ddu window appears<CR>
(close filter window) immediately after the filter window appearsWarning: I will close the issue without the minimal init.vim and the
reproduction instructions.
When calling ddu#ui#do_action('quit')
from insert mode of filter, the cursor position is shifted to the left when returning to the original buffer.
Keep the cursor position.
Latest
ddu-ui-ff version (SHA1): 0de01b6
denops.vim version (SHA1): 949a52412d35d56354f69bbbade6bcfe2951b8d6
deno version(deno -V
output): deno 1.33.4
OS:
neovim/Vim :version
output: NVIM v0.10.0-dev-0788394
set runtimepath+=/path/to/denops.vim
set runtimepath+=/path/to/ddu.vim
set runtimepath+=/path/to/ddu-ui-ff
set runtimepath+=/path/to/ddu-source-file_rec
set runtimepath+=/path/to/ddu-filter-matcher_substring
set runtimepath+=/path/to/ddu-kind-file
call ddu#custom#patch_global({
\ 'sources': [{'name': 'file_rec'}],
\ 'ui': 'ff',
\ 'uiParams': {
\ 'ff': {
\ 'startFilter': v:true,
\ },
\ },
\ 'sourceOptions': {
\ '_': {
\ 'ignoreCase': v:true,
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ 'kindOptions': {
\ '_': {
\ 'defaultAction': 'open',
\ },
\ },
\})
augroup my-ddu-ff
autocmd!
autocmd FileType ddu-ff-filter call <SID>ddu_ff_filter_mapping()
augroup END
function! s:ddu_ff_filter_mapping() abort
inoremap <buffer><silent> <Esc> <Cmd>call ddu#ui#do_action('quit')<CR>
endfunction
set debug=msg
ddu#start({})
.<Esc>
.The cursor that was over the "r" has moved one position to the left.
:redir
and :message
(if errored)Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
Previewing an item with item.word
containing |
will execute the string following |
.
Probably need to escape here.
ddu-ui-ff/denops/@ddu-ui-ff/preview.ts
Lines 272 to 291 in 36a0c44
|
is treated as just a string.
ddu-ui-ff version (SHA1): 36a0c44165ef081740b8721c7a8a4fe3b2a93e90
denops.vim version (SHA1): d7a15615f86830e9464c30f761a3911f619b38b3
deno version(deno -V
output): deno 1.33.1
OS: Linux (6.1.0-7-amd64)
neovim/Vim :version
output:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Mar 4 2023 19:53:01)
適用済パッチ: 1-1376
" Your minimal init.vim/vimrc
set runtimepath+=~/path/to/ddu.vim/
set runtimepath+=~/path/to/ddu-ui-ff/
set runtimepath+=~/path/to/test/
call ddu#custom#patch_global({
\ 'uiParams': {
\ 'ff': {
\ 'autoAction': {'name': 'preview'},
\ },
\ },
\})
~/path/to/test_kind/denops/@ddu-sources/test.ts
import { BaseSource, Item } from "https://deno.land/x/[email protected]/types.ts";
import { GatherArguments } from "https://deno.land/x/[email protected]/base/source.ts";
type Params = Record<never, never>;
export class Source extends BaseSource<Params> {
kind = "test";
gather(_args: GatherArguments<Params>): ReadableStream<Item<never>[]> {
return new ReadableStream({
start(controler) {
controler.enqueue([
{ word: "| !ls" },
]);
controler.close();
},
});
}
params(): Params {
return {};
}
}
~/path/to/test_kind/denops/@ddu-kinds/test.ts
import {
ActionArguments,
ActionFlags,
BaseKind,
Previewer,
} from "https://deno.land/x/[email protected]/types.ts";
import { GetPreviewerArguments } from "https://deno.land/x/[email protected]/base/kind.ts";
type Params = Record<never, never>;
export class Kind extends BaseKind<Params> {
actions: Record<
string,
(args: ActionArguments<Params>) => Promise<ActionFlags>
> = {};
getPreviewer(_args: GetPreviewerArguments): Promise<Previewer | undefined> {
return Promise.resolve({
kind: "nofile",
contents: ["hoge"],
});
}
params(): Params {
return {};
}
}
:call ddu#start({'ui': 'ff', 'sources': [{'name': 'test'}]})
:redir
and :message
(if errored)The problem was occurred with both vim and neovim which have these version:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 18 2022 21:40:10)
適用済パッチ: 1-4586
Compiled by Hibiki (4513ECHO)
NVIM v0.7.0-dev+1276-g0a81a33a9
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/hibiki/Develops/github.com/neovim/neovim/build/config -I/home/hibiki/Develops/github.com/neovim/neovim/src -I/home/hibiki/Develops/github.com/neovim/neovim/.deps/usr/include -I/usr/include -I/home/hibiki/Develops/github.com/neovim/neovim/build/src/nvim/auto -I/home/hibiki/Develops/github.com/neovim/neovim/build/include
Compiled by hibiki@rpi0ubuntu
Features: +acl +iconv +tui
See ":help feature-compile"
システム vimrc: "$VIM/sysinit.vim"
省略時の $VIM: "/usr/local/share/nvim"
Run :checkhealth for more info
ddu#start()
in insert modeif &compatible
set nocompatible
endif
set runtimepath+=~/.cache/nvim/dein/repos/github.com/vim-denops/denops.vim
set runtimepath+=~/.cache/nvim/dein/repos/github.com/Shougo/ddu.vim
set runtimepath+=~/.cache/nvim/dein/repos/github.com/Shougo/ddu-ui-ff
set runtimepath+=~/.cache/nvim/dein/repos/github.com/Shougo/ddu-kind-word
set runtimepath+=~/.cache/nvim/dein/repos/github.com/4513echo/ddu-source-emoji
inoremap <C-x><C-e>
\ <Cmd>call ddu#start({'sources': [{'name': 'emoji'}]})<CR>
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'kindOptions': {
\ 'word': {
\ 'defaultAction': 'append',
\ },
\ },
\ })
autocmd FileType ddu-ff call s:ddu_ff_my_settings()
function! s:ddu_ff_my_settings() abort
nnoremap <buffer> <CR>
\ <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
nnoremap <buffer> i
\ <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
nnoremap <buffer> q
\ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer> <CR> <Esc><Cmd>close<CR>
nnoremap <buffer> <CR> <Cmd>close<CR>
endfunction
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
Once an item has been previewed, previewing another item and then previewing it again will empty the buffer.
The following code may be the reason why the contents of the buffer are not saved.
ddu-ui-ff/denops/@ddu-ui-ff/preview.ts
Lines 231 to 245 in 36a0c44
preview contents are displayed.
ddu-ui-ff version (SHA1): 36a0c44165ef081740b8721c7a8a4fe3b2a93e90
denops.vim version (SHA1): d7a15615f86830e9464c30f761a3911f619b38b3
deno version(deno -V
output): deno 1.33.1
OS: Linux (6.1.0-7-amd64)
neovim/Vim :version
output:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Mar 4 2023 19:53:01)
適用済パッチ: 1-1376
" Your minimal init.vim/vimrc
set runtimepath+=~/path/to/ddu.vim/
set runtimepath+=~/path/to/ddu-ui-ff/
set runtimepath+=~/path/to/test/
call ddu#custom#patch_global({
\ 'uiParams': {
\ 'ff': {
\ 'autoAction': {'name': 'preview'},
\ },
\ },
\})
~/path/to/test_kind/denops/@ddu-sources/test.ts
import { BaseSource, Item } from "https://deno.land/x/[email protected]/types.ts";
import { GatherArguments } from "https://deno.land/x/[email protected]/base/source.ts";
type Params = Record<never, never>;
export class Source extends BaseSource<Params> {
kind = "test";
gather(_args: GatherArguments<Params>): ReadableStream<Item<never>[]> {
return new ReadableStream({
start(controler) {
controler.enqueue([
{ word: "test-1" },
{ word: "test-2" },
]);
controler.close();
},
});
}
params(): Params {
return {};
}
}
~/path/to/test_kind/denops/@ddu-kinds/test.ts
import {
ActionArguments,
ActionFlags,
BaseKind,
Previewer,
} from "https://deno.land/x/[email protected]/types.ts";
import { GetPreviewerArguments } from "https://deno.land/x/[email protected]/base/kind.ts";
type Params = Record<never, never>;
export class Kind extends BaseKind<Params> {
actions: Record<
string,
(args: ActionArguments<Params>) => Promise<ActionFlags>
> = {};
getPreviewer(_args: GetPreviewerArguments): Promise<Previewer | undefined> {
return Promise.resolve({
kind: "nofile",
contents: ["hoge"],
});
}
params(): Params {
return {};
}
}
:call ddu#start({'ui': 'ff', 'sources': [{'name': 'test'}]})
(preview test-1
)j
(preview test-2
)k
(preview test-1
):redir
and :message
(if errored)Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
When using autoAction, startFilter and split float, the filter window may not open properly.
Open the filter window normally.
ddu-ui-ff version (SHA1): b7aa22b828c3198298d703f9b7123b9c53d0f8d4
denops.vim version (SHA1): 8f3899de3d3add07105221262dca90a31c4c2d4c
deno version(deno -V
output): deno 1.30.3
OS: Arch Linux
neovim/Vim :version
output:
NVIM v0.9.0-dev-888+g81c5483dcb
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fno-common -fdiagnostics-color=always -fstack-protector-strong -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -DNVIM_UNIBI_HAS_VAR_FROM -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/home/hyuoou/.cache/paru/clone/neovim-git/src/build/src/nvim/auto -I/home/hyuoou/.cache/paru/clone/neovim-git/src/build/include -I/home/hyuoou/.cache/paru/clone/neovim-git/src/build/cmake.config -I/home/hyuoou/.cache/paru/clone/neovim-git/src/neovim/src -I/usr/include -I/usr/include -I/usr/include
Compiled by hyuoou
Features: +acl +tui
See ":help feature-compile"
システム vimrc: "$VIM/sysinit.vim"
省略時の $VIM: "/usr/share/nvim"
Run :checkhealth for more info
set runtimepath^=~/plugins/denops.vim
set runtimepath^=~/plugins/ddu.vim
set runtimepath^=~/plugins/ddu-ui-ff
set runtimepath^=~/plugins/ddu-source-file_rec
set runtimepath^=~/plugins/ddu-filter-matcher_substring
set runtimepath^=~/plugins/ddu-kind-file
set runtimepath^=~/plugins/tokyonight.nvim
colorscheme tokyonight
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'sources': [{'name': 'file_rec', 'params': {}}],
\ 'uiParams': {
\ 'ff': {
\ 'split': 'floating',
\ 'startFilter': v:true,
\ 'autoAction': {'name': 'preview'},
\ },
\ },
\ 'sourceOptions': {
\ '_': {
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ 'kindOptions': {
\ 'file': {
\ 'defaultAction': 'open',
\ },
\ }
\ })
autocmd FileType ddu-ff call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> <CR> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
nnoremap <buffer><silent> i <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
nnoremap <buffer><silent> q <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer><silent> <CR> <Esc><Cmd>call ddu#ui#ff#close()<CR>
endfunction
call ddu#start({})
call ddu#start({})
again:redir
and :message
(if errored)Error like this is thrown when opening floating ddu window with the following step.
[denops] error: Uncaught (in worker "ddu") (in promise) Error: Failed to call 'call' with ["ddu#ui#ff#filter#_floating",3,1003,{"autoResize":true,"cursorPos":-1,"displaySourceName":"no","floatingBorder":"none","filterFloatingPosition":"top","filterSplitDirection":"floating","filterUpdateTime":0,"highlights":{},"ignoreEmpty":true,"previewFloating":false,"previewHeight":10,"previewVertical":false,"previewWidth":40,"prompt":"","reversed":false,"split":"floating","splitDirection":"botright","startFilter":false,"winCol":47,"winHeight":20,"winRow":15,"winWidth":95}]: Error: Failed to call 'nvim_call_function' with ["ddu#ui#ff#filter#_floating",[3,1003,{"autoResize":true,"cursorPos":-1,"displaySourceName":"no","floatingBorder":"none","filterFloatingPosition":"top","filterSplitDirection":"floating","filterUpdateTime":0,"highlights":{},"ignoreEmpty":true,"previewFloating":false,"previewHeight":10,"previewVertical":false,"previewWidth":40,"prompt":"","reversed":false,"split":"floating","splitDirection":"botright","startFilter":false,"winCol":47,"winHeight":20,"winRow":15,"winWidth":95}]]: [0,"Vim(call):E5555: API call: Wrong type for argument 1 when calling nvim_win_set_config, expecting Window"]
[denops] at Session.call (https://deno.land/x/[email protected]/session.ts:207:13)
[denops] at async Service.call (file:///home/denjo/.cache/dein/.cache/init.vim/.dein/denops/@denops-private/service.ts:86:12)
[denops] at async Session.call (file:///home/denjo/.cache/dein/.cache/init.vim/.dein/denops/@denops-private/service.ts:135:14)
[denops] at async Session.dispatch (https://deno.land/x/[email protected]/session.ts:99:12)
[denops] at async https://deno.land/x/[email protected]/session.ts:108:18
[denops] at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
[denops] throw new Error(
[denops] ^
[denops] at Session.call (https://deno.land/x/[email protected]/session.ts:207:13)
[denops] at async DenopsImpl.call (file:///home/denjo/.cache/dein/.cache/init.vim/.dein/denops/@denops/impl.ts:28:12)
[denops] at async Ui.redraw (file:///home/denjo/.cache/dein/.cache/init.vim/.dein/denops/@ddu-uis/ff.ts:174:9)
[denops] at async file:///home/denjo/.cache/dein/.cache/init.vim/.dein/denops/ddu/ddu.ts:269:7
[denops] at async Lock.with (https://deno.land/x/[email protected]/lock.ts:23:7)
[denops] at async Ddu.redraw (file:///home/denjo/.cache/dein/.cache/init.vim/.dein/denops/ddu/ddu.ts:268:5)
[denops] at async readChunk (file:///home/denjo/.cache/dein/.cache/init.vim/.dein/denops/ddu/ddu.ts:193:11)
[denops] error: Uncaught (in promise) Error: Unhandled error event in child worker.
[denops] at Worker.#pollControl (deno:runtime/js/11_workers.js:168:21)
[denops] Server stopped (1). Restarting...
[denops] Server is restarted.
Neovim v0.7.0
set runtimepath+=~/.cache/dein/repos/github.com/vim-denops/denops.vim
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu.vim
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu-ui-ff
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu-kind-file
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu-source-file
nnoremap <Space>f
\ <Cmd>call ddu#start({'sources': [{'name': 'file'}]})<CR>
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'uiParams': {'ff': {
\ 'split': 'floating',
\ 'autoResize': v:true,
\ }},
\ })
autocmd FileType ddu-ff call s:ddu_ff_my_settings()
function! s:ddu_ff_my_settings() abort
nnoremap <buffer> i
\ <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
nnoremap <buffer> q
\ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer> <CR> <Esc><Cmd>close<CR>
endfunction
<Space>f
(start ddu)i
(open filter window) and <CR>
(close filter)q
(quit ddu)<Space>f
(reopen ddu window) and you will see errorWarning: I will close the issue without the minimal init.vim and the
reproduction instructions.
When positioning the filter window at the bottom using float display, the layout becomes distorted.
Filter and source borders are displayed properly and highlighting is set correctly.
ddu-ui-ff version (SHA1):
87e95b80226f591f53b5e2afed1d9f16838a2d38
denops.vim version (SHA1):
8f3899de3d3add07105221262dca90a31c4c2d4c
deno version(deno -V
output):
deno 1.30.3
OS:
Ubuntu 22.04
(WSL2)neovim/Vim :version
output:
NVIM v0.9.0-dev-1088+gd66832c76
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
" Your minimal init.vim/vimrc
syntax enable
filetype plugin indent on
set rtp+=~/path/to/denops.vim
set rtp+=~/path/to/ddu.vim
set rtp+=~/path/to/ddu-ui-ff
set rtp+=~/path/to/ddu-kind-file
set rtp+=~/path/to/ddu-source-file_rec
let s:ddu_config_json =<< trim MARK
{
"uiParams": {
"ff": {
"split": "floating",
"floatingBorder": "rounded",
"startFilter": true,
"filterFloatingPosition": "bottom",
"filterSplitDirection": "floating"
}
}
}
MARK
let s:ddu_config_json = s:ddu_config_json->join('')->json_decode()
call ddu#custom#patch_global(s:ddu_config_json)
nnoremap [ddu] <Nop>
nmap <Space>u [ddu]
nmap <silent> [ddu]f <Cmd>call ddu#start({
\ 'ui': 'ff',
\ 'sources': [{'name': 'file_rec', 'params': {}}],
\ })<CR>
<Space>
u
f
:redir
and :message
(if errored)Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
ddu-ff-filter-default
should be opened only once.
ddu-ui-ff version (SHA1): 15196ec
denops.vim version (SHA1): 3b489d50ba2e034c829a09475a4002176bffbef7
deno version(deno -V
output): deno 1.32.2
OS: MacOS 13.4 (22F66)
neovim/Vim :version
output: NVIM v0.9.0, Build type: Release, LuaJIT 2.1.0-beta3
packadd denops.vim
packadd ddu.vim
packadd ddu-ui-ff
packadd ddu-filter-matcher_substring
packadd ddu-kind-file
packadd ddu-source-file_rec
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'uiParams': {
\ 'ff': { 'startFilter': v:true },
\ },
\ 'sourceOptions': {
\ '_': { 'matchers': ['matcher_substring'] },
\ },
\ 'kindOptions': {
\ 'file': { 'defaultAction': 'open' }
\ }
\ })
nmap <space>f <Cmd>call ddu#start(#{ sources: [#{ name: 'file_rec' }] })<CR>
<space>f
to open ddu ff<Esc>
<space>f
again:redir
and :message
(if errored)No message
Please consider adding support for vim's popup window which is an alternative to neovim's floating window mechanism.
https://github.com/vim/vim/blob/master/runtime/doc/popup.txt
See also: vim/vim#4063
The statusline was cleared as default when 'laststatus'
is 3.
I think it can be fixed by the way which is same as Shougo/pum.vim@411ac9e
Denite keeps the history of input and you retrieve previously inputted queries with C-u.
I'm wondering if you could implement the same feature in ddu too.
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
When re-open ddu buffer, raise E444 and filter buffer is replaced by preview buffer.
It seem to occur when 'autoAction': { 'name': 'preview' }
is specified.
Raise no error, open filter buffer.
$ git rev-parse HEAD
53e4490e74de37deabf8a23dc9fa8eced1a7a1a0
$ git rev-parse HEAD
a40e0c10be0c67b5fd6cb9713914b9259dafa7e2
deno -V
output):$ deno --version
deno 1.24.2 (release, x86_64-unknown-linux-gnu)
v8 10.4.132.20
typescript 4.7.4
Ubuntu 20.04.4 LTS (via WSL2)
:version
output:NVIM v0.8.0-dev-810-g252dea592
Build type: Release
LuaJIT 2.1.0-beta3
set runtimepath^=/tmp/ddu-issue/denops.vim
set runtimepath^=/tmp/ddu-issue/ddu.vim
set runtimepath^=/tmp/ddu-issue/ddu-ui-ff
set runtimepath^=/tmp/ddu-issue/ddu-kind-file
set runtimepath^=/tmp/ddu-issue/ddu-filter-matcher_substring
set runtimepath^=/tmp/ddu-issue/ddu-source-file_rec
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'sources': [{'name': 'file_rec', 'params': {}}],
\ 'sourceOptions': {
\ '_': {
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ 'kindOptions': {
\ 'file': {
\ 'defaultAction': 'open',
\ },
\ },
\ 'uiParams': {
\ 'ff': {
\ 'autoAction': { 'name': 'preview' },
\ 'startFilter': v:true,
\ },
\ },
\ })
call ddu#start({})
ddu-ff-default
buffer and move cursorcall ddu#start({})
:redir
and :message
(if errored)[ddu] ui: ff "redraw()" failed
[ddu] Vim(close):E444: Cannot close last window
[ddu] BatchError: Vim(close):E444: Cannot close last window^@ at DenopsImpl.batch (file:///tmp/ddu-issue/denops.vim/denops/@denops/impl.ts:45:13)^@ at async batch (https://deno.land/x/[email protected]/batch/batch.ts:98:3)^@ at async PreviewUi.close (file:///tmp/ddu-issue/ddu-ui-ff/denops/@ddu-ui-ff/preview.ts:37:7)^@ at async Ui.redraw (file:///tmp/ddu-issue/ddu-ui-ff/denops/@ddu-uis/ff.ts:115:7)^@ at async file:///tmp/ddu-issue/ddu.vim/denops/ddu/ddu.ts:1441:7^@ at async Lock.with (https://deno.land/x/[email protected]/lock.ts:23:7)^@ at async uiRedraw (file:///tmp/ddu-issue/ddu.vim/denops/ddu/ddu.ts:1439:3)^@ at async Ddu.uiRedraw (file:///tmp/ddu-issue/ddu.vim/denops/ddu/ddu.ts:429:5)^@ at async Ddu.start (file:///tmp/ddu-issue/ddu.vim/denops/ddu/ddu.ts:195:5)^@ at async Session.start (file:///tmp/ddu-issue/ddu.vim/denops/ddu/app.ts:130:7)
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
If floating is enabled, the filtered items will be hidden.
When filtering, the scroll position will be the topmost.
ddu-ui-std version (SHA1): 8b86d54
ddu.vim version (SHA1): e876d13b656a35232fa9f371a9c9cc9ba2a09f5d
denops.vim version (SHA1): e2f17041495123e8ed9baa69098c947c5d7f6358
deno version(deno -V
output): 1.18.1
OS: Mac
neovim/Vim :version
output:
NVIM v0.7.0-dev+997-g21cdecc8e
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-21cdecc/share/nvim"
Run :checkhealth for more info
:checkhealth
or :CheckHealth
result(neovim only): OKif &compatible
set nocompatible
endif
let $CACHE = expand('~/.cache')
if !isdirectory(expand($CACHE))
call mkdir(expand($CACHE), 'p')
endif
let s:dein_dir = expand('$CACHE/dein')
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
if &runtimepath !~# '/dein.vim'
if !isdirectory(s:dein_repo_dir)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir
endif
execute 'set runtimepath^=' . s:dein_repo_dir
endif
call dein#begin(s:dein_dir, expand('<sfile>'))
call dein#add('vim-denops/denops.vim')
call dein#add('Shougo/ddu.vim')
call dein#add('Shougo/ddu-commands.vim')
call dein#add('Shougo/ddu-ui-std')
call dein#add('Shougo/ddu-filter-matcher_substring')
call dein#add('Shougo/ddu-source-file_rec')
call dein#add('Shougo/ddu-kind-file')
call dein#end()
call dein#save_state()
call ddu#custom#patch_global({
\ 'ui': 'std',
\ 'sourceOptions': {
\ '_': {
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ 'uiParams': {
\ 'std': {
\ 'split': 'floating'
\ },
\ },
\ })
autocmd FileType ddu-std call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> <CR>
\ <Cmd>call ddu#ui#std#do_action('itemAction')<CR>
nnoremap <buffer><silent> i
\ <Cmd>call ddu#ui#std#do_action('openFilterWindow')<CR>
nnoremap <buffer><silent> q
\ <Cmd>call ddu#ui#std#do_action('quit')<CR>
endfunction
autocmd FileType ddu-std-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer><silent> <CR>
\ <Esc><Cmd>close<CR>
nnoremap <buffer><silent> <CR>
\ <Cmd>close<CR>
endfunction
ddu-ui-std
without filtering.ddu-ui-std
.ddu-ui-std
will not be refreshed and the upper item will be hidden. (You need to scroll to see it.)This is the result of filtering after scrolling.
The actual filtered results will not be visible without scrolling up.
startFilter=v:trueのとき、filter window にあるカーソルがノーマルモードになっている。
カーソルがインサートモードになっていること
OS : Windows11
vim : gvim。バージョンは、スクリーンショット参照
deno : 1.18.1
vimプラグイン : PlugUpdateして、2022/01/30時点の最新の状態になっている
set encoding=utf-8
scriptencoding utf-8
" 単体動作テスト用 {{{1
if &compatible
set nocompatible " Be iMproved
endif
if empty(glob('c:/takeda/tools/vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall | source $MYVIMRC
endif
call plug#begin('c:/takeda/tools/vim/plugged')
Plug 'vim-denops/denops.vim'
Plug 'Shougo/ddu.vim'
Plug 'Shougo/ddu-commands.vim'
Plug 'Shougo/ddu-ui-std'
Plug 'Shougo/ddu-source-line'
Plug 'Shougo/ddu-filter-matcher_substring'
Plug 'Shougo/ddu-kind-file'
call plug#end()
call ddu#custom#patch_global({
\ 'ui': 'std',
\ })
" Specify matcher.
call ddu#custom#patch_global({
\ 'sourceOptions' : {
\ '_' : {
\ 'ignoreCase': v:true,
\ 'matchers': ['matcher_substring'],
\ }
\ }
\ })
autocmd FileType ddu-std call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> <CR>
\ <Cmd>call ddu#ui#std#do_action('itemAction')<CR>
nnoremap <buffer><silent> <Space>
\ <Cmd>call ddu#ui#std#do_action('toggleSelectItem')<CR>
nnoremap <buffer><silent> i
\ <Cmd>call ddu#ui#std#do_action('openFilterWindow')<CR>
nnoremap <buffer><silent> q
\ <Cmd>call ddu#ui#std#do_action('quit')<CR>
endfunction
autocmd FileType ddu-std-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer><silent> <CR>
\ <Esc><Cmd>close<CR>
nnoremap <buffer><silent> <CR>
\ <Cmd>close<CR>
endfunction
" }}}1
:PlugUpdate
を実行して、プラグインを最新の状態に更新する:e vimrc
を実行する:Ddu -name=search line -ui-param-startFilter=v:true
を実行するaaa
と入力するインサートモードであるはずのfilter windowに aaa
と入力されるはずが、 aa
のみが表示される。
a
がノーマルモードで処理され、 残りの aa
がインサートモードで入力されているためと思われる。
First of all, I'd like to say Thank you for creating great plugin, I'm really enjoying use this!
I was caught the error as following.
function ddu#ui#ff#do_action[1]..ddu#ui_action[1]..ddu#_request[6]..denops#request[1]..denops#server#request[6]..<SNR>97_request の処理中にエラーが検出されました:
行 1:
Error invoking 'invoke' on channel 4:
Error: Failed to call 'uiAction' with ["default","preview",{}]: Error: Failed to call 'call' with ["ddu#ui#ff#_preview_file",{"autoResize":false,"cursorPos":-1,"displaySourceName":"no","filterFloatingPosition":"top","filterSplitDirection":"
floating","filterUpdateTime":0,"previewHeight":10,"previewVertical":true,"previewFloating":true,"previewWidth":40,"prompt":"","reversed":false,"split":"floating","splitDirection":"botright","startFilter":false,"winCol":0,"winHeight":20,"win
Row":0,"winWidth":0},"/Users/ryutooooo/dotfiles/setup.sh"]: Error: Failed to call 'nvim_call_function' with ["ddu#ui#ff#_preview_file",[{"autoResize":false,"cursorPos":-1,"displaySourceName":"no","filterFloatingPosition":"top","filterSplitD
irection":"floating","filterUpdateTime":0,"previewHeight":10,"previewVertical":true,"previewFloating":true,"previewWidth":40,"prompt":"","reversed":false,"split":"floating","splitDirection":"botright","startFilter":false,"winCol":0,"winHeig
ht":20,"winRow":0,"winWidth":0},"/Users/ryutooooo/dotfiles/setup.sh"]]: [0,"Vim(let):E716: Key not present in Dictionary: \"winrow\""]
at Session.call (https://deno.land/x/[email protected]/session.ts:207:13)
at async Service.call (file:///Users/ryutooooo/.config/nvim/plugged/denops.vim/denops/@denops-private/service.ts:86:12)
at async Session.call (file:///Users/ryutooooo/.config/nvim/plugged/denops.vim/denops/@denops-private/service.ts:135:14)
at async Session.dispatch (https://deno.land/x/[email protected]/session.ts:99:12)
at async https://deno.land/x/[email protected]/session.ts:108:18
at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
at Session.call (https://deno.land/x/[email protected]/session.ts:207:13)
at async DenopsImpl.call (file:///Users/ryutooooo/.config/nvim/plugged/denops.vim/denops/@denops/impl.ts:28:12)
at async preview (file:///Users/ryutooooo/.config/nvim/plugged/ddu-ui-ff/denops/@ddu-uis/ff.ts:370:7)
at async Ddu.uiAction (file:///Users/ryutooooo/.config/nvim/plugged/ddu.vim/denops/ddu/ddu.ts:299:19)
at async Session.uiAction (file:///Users/ryutooooo/.config/nvim/plugged/ddu.vim/denops/ddu/app.ts:204:7)
at async Session.dispatch (https://deno.land/x/[email protected]/session.ts:99:12)
at async https://deno.land/x/[email protected]/session.ts:108:18
at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
at Session.call (https://deno.land/x/[email protected]/session.ts:207:13)
at async Service.dispatch (file:///Users/ryutooooo/.config/nvim/plugged/denops.vim/denops/@denops-private/service.ts:101:14)
at async Session.invoke (file:///Users/ryutooooo/.config/nvim/plugged/denops.vim/denops/@denops-private/host/nvim.ts:48:16)
at async Session.dispatch (https://deno.land/x/[email protected]/session.ts:99:12)
at async https://deno.land/x/[email protected]/session.ts:108:18
at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
Error message is showing as below
[0,"Vim(let):E716: Key not present in Dictionary: \"winrow\""]
Then I tried to modify following part to winRow
and winCol
.
ddu-ui-ff/autoload/ddu/ui/ff.vim
Lines 105 to 106 in 0812785
The error never shows up, following image is showing the result.
neovim
: NVIM v0.7.0-dev+914-g7717f38d3silent! let g:plugs['ddu-filter-matcher_substring'].commit = '4f5109aca2d3f10d6f0ffe258f79873aa8c51ae2'
silent! let g:plugs['ddu-kind-file'].commit = 'b824ea5be94340e5de3772e529880ad6a8a0a182'
silent! let g:plugs['ddu-source-file_rec'].commit = '614138553618fb973770800d1ef54b577cd866a5'
silent! let g:plugs['ddu-ui-ff'].commit = 'e41791bd5d9c2a36beb6ff946067cbee395507e0'
silent! let g:plugs['ddu.vim'].commit = 'cb0ec8d79727b96bb734a3e0a5c170e7ae394395'
silent! let g:plugs['denops.vim'].commit = '333aa1783352c346cc4fbaa43217bbc1c07ddbaa'
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
SSIA
preview window's width and main window's width should be same.
Or user can setting preview window's width when setting when setting previewSplit
is horizontal
.
deno -V
output)::version
output:set rtp+=~/.cache/dein/nvim/repos/github.com/vim-denops/denops.vim
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu.vim
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-ui-ff
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-source-file_rec
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-kind-file
nnoremap [ddu] <Nop>
nmap <Space>u [ddu]
nmap <silent> [ddu]f <Cmd>call ddu#start({
\ 'ui': 'ff',
\ 'uiParams': {
\ 'ff': {
\ 'startFilter': v:true,
\ 'autoAction': {
\ 'name': 'preview',
\ },
\ 'split': 'floating',
\ 'filterFloatingPosition': 'bottom',
\ 'previewFloating': v:true,
\ 'floatingBorder': 'rounded',
\ 'previewFloatingBorder': 'rounded',
\ }
\ },
\ 'sources': [{'name': 'file_rec', 'params': {}}],
\ })<CR>
<Space>
u
f
for start ddu:redir
and :message
(if errored)If user immediately closes the FF window, get a text property error (E275).
Close FF window without error.
ddu-ui-ff version (SHA1): 7a18cfc
denops.vim version (SHA1): vim-denops/denops.vim@3c3a0f9
ddu.vim version (SHA1): Shougo/ddu.vim@fdc1ac7
deno version(deno -V
output): deno 1.28.2
OS: Windows 10 22H2 (19045.2251)
neovim/Vim :version
output:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Nov 22 2022 23:29:02)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-924
" vimrc
set nocompatible
set rtp^=~/path/to/denops.vim
set rtp^=~/path/to/ddu.vim
set rtp^=~/path/to/ddu-ui-ff
call ddu#custom#patch_global(#{
\ ui: 'ff',
\ sources: [ #{ name: 'testsource', params: {} } ],
\})
nnoremap gy <Cmd>call ddu#start({})<CR>
autocmd FileType ddu-ff
\ nnoremap <buffer> q <Cmd>call ddu#ui#ff#do_action('quit')<CR>
" testing
" 1. Start ddu.
autocmd User DenopsPluginPost:ddu call timer_start(1000, {-> feedkeys('gy')})
" 2. Quit ddu-ff immediately.
autocmd FileType ddu-ff call timer_start(100, {-> feedkeys('q')})
Test source that returns Item.highlights
.
// denops/@ddu-sources/testsource
import { delay } from "https://deno.land/[email protected]/async/delay.ts";
import { BaseSource } from "https://deno.land/x/[email protected]/types.ts";
import type { Item } from "https://deno.land/x/[email protected]/types.ts";
type Params = Record<never, never>;
export type ActionData = {
text: string;
};
export class Source extends BaseSource<Params> {
override kind = "word";
override gather(): ReadableStream<Item<ActionData>[]> {
return new ReadableStream({
async start(controller) {
const items: Item<ActionData>[] = [
{
word: "a:foo",
action: {
text: "foo",
},
highlights: [
{
name: "header",
hl_group: "ErrorMsg",
col: 1,
width: 2,
},
],
},
];
controller.enqueue(items);
controller.close();
},
});
}
override params(): Params {
return {};
}
}
vim -u vimrc
.:redir
and :message
(if errored)[ddu] ui: ff "redraw()" failed
[ddu] Failed to call 'call' with ["ddu#ui#ff#_highlight_items",{"autoAction":{},"autoResize":false,"cursorPos":-1,"displaySourceName":"no","displayTree":false,"filterFloatingPosition":"bottom","filterSplitDirection":"botright","filterUpdateTime":0,"floatingBorder":"none","highlights":{},"ignoreEmpty":false,"previewCol":0,"previewFloating":false,"previewFloatingBorder":"none","previewFloatingZindex":50,"previewHeight":10,"previewRow":0,"previewVertical":false,"previewWidth":40,"prompt":"","reversed":false,"replaceCol":0,"split":"horizontal","splitDirection":"botright","startFilter":false,"statusline":true,"winCol":20,"winHeight":20,"winRow":2,"winWidth":40},2,1,[{"highlights":[{"name":"header","hl_group":"ErrorMsg","col":1,"width":2}],"row":1,"prefix":""}],[]]: Error: Failed to call 'ddu#ui#ff#_highlight_items([object Object], 2, 1, [object Object], )': Vim(call):E275: Cannot add text property to unloaded buffer
function ddu#ui#ff#do_action[13]..ddu#ui_action[1]..ddu#_request[22]..denops#request[1]..denops#server#request[6]..<SNR>23_request[1]..denops#api#vim#call[2]..ddu#ui#ff#_highlight_items[12]..ddu#ui#ff#_highlight, line 22
at Vim.call (file:///tmp/denops.vim/denops/@denops-private/host/vim.ts:37:13)
at async Session.call (file:///tmp/denops.vim/denops/@denops-private/service.ts:170:14)
at async Session.dispatch (https://deno.land/x/[email protected]/session.ts:99:12)
at async https://deno.land/x/[email protected]/session.ts:108:18
at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
[ddu] Error: Failed to call 'call' with ["ddu#ui#ff#_highlight_items",{"autoAction":{},"autoResize":false,"cursorPos":-1,"displaySourceName":"no","displayTree":false,"filterFloatingPosition":"bottom","filterSplitDirection":"botright","filterUpdateTime":0,"floatingBorder":"none","highlights":{},"ignoreEmpty":false,"previewCol":0,"previewFloating":false,"previewFloatingBorder":"none","previewFloatingZindex":50,"previewHeight":10,"previewRow":0,"previewVertical":false,"previewWidth":40,"prompt":"","reversed":false,"replaceCol":0,"split":"horizontal","splitDirection":"botright","startFilter":false,"statusline":true,"winCol":20,"winHeight":20,"winRow":2,"winWidth":40},2,1,[{"highlights":[{"name":"header","hl_group":"ErrorMsg","col":1,"width":2}],"row":1,"prefix":""}],[]]: Error: Failed to call 'ddu#ui#ff#_highlight_items([object Object], 2, 1, [object Object], )': Vim(call):E275: Cannot add text property to unloaded buffer
function ddu#ui#ff#do_action[13]..ddu#ui_action[1]..ddu#_request[22]..denops#request[1]..denops#server#request[6]..<SNR>23_request[1]..denops#api#vim#call[2]..ddu#ui#ff#_highlight_items[12]..ddu#ui#ff#_highlight, line 22
at Vim.call (file:///tmp/denops.vim/denops/@denops-private/host/vim.ts:37:13)
at async Session.call (file:///tmp/denops.vim/denops/@denops-private/service.ts:170:14)
at async Session.dispatch (https://deno.land/x/[email protected]/session.ts:99:12)
at async https://deno.land/x/[email protected]/session.ts:108:18
at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
at Session.call (https://deno.land/x/[email protected]/session.ts:207:13)
at async DenopsImpl.call (file:///tmp/denops.vim/denops/@denops/impl.ts:34:12)
at async Ui.redraw (file:///C:/tmp/ddu-ui-ff/denops/@ddu-uis/ff.ts:350:5)
at async file:///tmp/ddu.vim/denops/ddu/ddu.ts:1501:7
at async Lock.with (https://deno.land/x/[email protected]/lock.ts:23:7)
at async uiRedraw (file:///tmp/ddu.vim/denops/ddu/ddu.ts:1499:3)
at async Ddu.uiRedraw (file:///tmp/ddu.vim/denops/ddu/ddu.ts:458:5)
at async Ddu.redraw (file:///tmp/ddu.vim/denops/ddu/ddu.ts:408:5)
at async readChunk (file:///tmp/ddu.vim/denops/ddu/ddu.ts:366:9)
:edit
any file:call ddu#custom#set_global(#{ui: 'ff'})
:call ddu#start(#{sources: [#{name: 'file'}]})
:call ddu#ui#ff#do_action('chooseAction')
cd
and :call ddu#ui#ff#do_action('itemAction', #{name: 'do'})
:enew
is executed at that windowWhatever action you select at step 7, the same thing will occur.
The windows is not cleared; just do what is selected at step 7 (closing the FF UI).
This problem was resolved when I tried next patch. I don't know whether it has any side effects, but I didn't find one.
diff --git a/denops/@ddu-uis/ff.ts b/denops/@ddu-uis/ff.ts
index 7f2c47f..4caaaa8 100644
--- a/denops/@ddu-uis/ff.ts
+++ b/denops/@ddu-uis/ff.ts
@@ -309,7 +309,7 @@ export class Ui extends BaseUi<Params> {
}
if ((await fn.winnr(args.denops, "$")) == 1) {
- await args.denops.cmd("enew");
+ await args.denops.cmd(`buffer ${args.context.bufNr}`);
} else {
await args.denops.cmd("close!");
await fn.win_gotoid(args.denops, args.context.winId);
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
The cursor position is reset randomly. It seems ddu does not keep the cursor position in async load?
The cursor position is persistent
ddu-ui-ff version (SHA1):
denops.vim version (SHA1):
deno version(deno -V
output):
OS:
neovim/Vim :version
output:
if exists('+compatible') && &compatible
set nocompatible
endif
" Disable Vim's native pack feature
set packpath=
" Clone https://github.com/lambdalisue/fern.vim in somewhere
" and specify that directory to the below
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/vim-denops/denops.vim
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/Shougo/ddu.vim
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/Shougo/ddu-ui-ff
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/Shougo/ddu-source-file_rec
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/Shougo/ddu-filter-matcher_substring
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/EdenEast/nightfox.nvim
filetype plugin indent on
syntax on
"----------------------------------------------------------------
nnoremap ; :
nnoremap : ;
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'sources': [
\ {
\ 'name': 'file_rec',
\ },
\ ],
\ 'sourceOptions': {
\ '_': {
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ 'uiParams': {
\ 'ff': {
\ 'split': 'floating',
\ 'startFilter': v:true,
\ 'prompt': '> ',
\ },
\ },
\})
function! s:my_ddu_ff() abort
nnoremap <buffer><silent> <Esc>
\ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction
function! s:my_ddu_ff_filter() abort
inoremap <buffer><silent> <Esc> <Esc><Cmd>call ddu#ui#ff#close()<CR>
nnoremap <buffer><silent> <Esc> <Cmd>call ddu#ui#ff#close()<CR>
inoremap <buffer><silent> <C-n>
\ <Cmd>call ddu#ui#ff#execute("call cursor(line('.')+1,0)")<CR>
inoremap <buffer><silent> <C-p>
\ <Cmd>call ddu#ui#ff#execute("call cursor(line('.')-1,0)")<CR>
endfunction
augroup my-ddu
autocmd!
autocmd FileType ddu-ff call s:my_ddu_ff()
autocmd FileType ddu-ff-filter call s:my_ddu_ff_filter()
augroup END
colorscheme nightfox
"----------------------------------------------------------------
echomsg "Custom minimal vimrc has loaded"
:cd ~
(or wherevever a directory that has a lot of children):call ddu#start({})
<C-n>
and wait:redir
and :message
(if errored)Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
Once I open the ddu-ui-ff with specified directory, and then when I open the ddu-ui-ff with different directory (like after :tcd
), it does not work.
cursor mark is still displayed after
ddu-ui-ff version (SHA1):
56c6ef2
denops.vim version (SHA1):
949a52412d35d56354f69bbbade6bcfe2951b8d6
deno version(deno -V
output):
deno 1.30.3
OS:
WSL2 Ubuntu-22.04
neovim/Vim :version
output:
NVIM v0.9.0-dev-1088+gd66832c76
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
set rtp+=/home/kamecha_linux/workspace/Plugin/min-plugin/tmp/vim-denops/denops.vim
set rtp+=/home/kamecha_linux/workspace/Plugin/min-plugin/tmp/Shougo/ddu.vim
set rtp+=/home/kamecha_linux/workspace/Plugin/min-plugin/tmp/Shougo/ddu-ui-ff
set rtp+=/home/kamecha_linux/workspace/Plugin/min-plugin/tmp/Shougo/ddu-source-file_rec
set rtp+=/home/kamecha_linux/workspace/Plugin/min-plugin/tmp/Shougo/ddu-kind-file
nnoremap [ddu] <Nop>
nmap <Space>u [ddu]
nmap <silent> [ddu]f <Cmd>call ddu#start({
\ 'ui': 'ff',
\ 'sources': [{'name': 'file_rec', 'params': {}}],
\ })<CR>
autocmd FileType ddu-ff call s:ddu_my_settings()
function! s:ddu_my_settings() abort
setlocal signcolumn=yes
nnoremap <buffer><silent> q
\ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
autocmd CursorMoved <buffer> call s:update_cursor()
function! s:update_cursor()
sign unplace 100
sign define cursor text=>> texthl=Constant
execute printf('sign place 100 line=%d name=cursor file=%s',
\ '.'->line(), '%:p'->expand())
endfunction
endfunction
:tabnew ../hogehoge
):tcd %:h
:redir
and :message
(if errored)Error detected while processing CursorMoved Autocommands for "<buffer=2>"..function <SNR>3_update_cursor:
line 3:
E158: Invalid buffer name: /home/kamecha_linux/workspace/Plugin/ddu-source-window/ddu-ff-default
Error detected while processing CursorMoved Autocommands for "<buffer=2>"..function <SNR>3_update_cursor:
line 3:
E158: Invalid buffer name: /home/kamecha_linux/workspace/Plugin/ddu-source-window/ddu-ff-default
Error detected while processing CursorMoved Autocommands for "<buffer=2>"..function <SNR>3_update_cursor:
line 3:
E158: Invalid buffer name: /home/kamecha_linux/workspace/Plugin/ddu-source-window/ddu-ff-default
Error detected while processing CursorMoved Autocommands for "<buffer=2>"..function <SNR>3_update_cursor:
line 3:
E158: Invalid buffer name: /home/kamecha_linux/workspace/Plugin/ddu-source-window/ddu-ff-default
Error detected while processing CursorMoved Autocommands for "<buffer=2>"..function <SNR>3_update_cursor:
line 3:
E158: Invalid buffer name: /home/kamecha_linux/workspace/Plugin/ddu-source-window/ddu-ff-default
Error detected while processing CursorMoved Autocommands for "<buffer=2>"..function <SNR>3_update_cursor:
line 3:
E158: Invalid buffer name: /home/kamecha_linux/workspace/Plugin/ddu-source-window/ddu-ff-default
Error detected while processing CursorMoved Autocommands for "<buffer=2>"..function <SNR>3_update_cursor:
line 3:
E158: Invalid buffer name: /home/kamecha_linux/workspace/Plugin/ddu-source-window/ddu-ff-default
Hi Shougo.
Thx a lot for the ddu
series of plugins of course. (And a late 'thx-a-lot' for the denite.nvim, unite.vim... plugins as well). Still can't figure out what your avatar on github is meant to be (its not a zebra-dragon is it? 😉)
When invoking the preview
action on a file
kind/source the emerging preview window has its previewwindow
option set to nopreviewwindow
.
As of now there is only on big problem I have with this fact. I really like to use the vim-preview plugin to scroll the preview window while leaving the cursor in the denite
-window and I am missing this functionality in ddu
.
I would expect the ddu-ff preview window to have its previewwindow
option set to previewwindow
ddu-ui-ff version (SHA1): c5958937bd73b262642aec93f9ff0623c4250e67
denops.vim version (SHA1): d7db28587bb281f9fcf56d4986e313025e250295
deno version(deno -V
output): deno 1.21.1
OS: GNU/Linux
neovim/Vim :version
output:
NVIM v0.8.0-dev-1071-gf98cff957
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by lorenz@chicken
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/share/nvim"
Run :checkhealth for more info
" Your minimal init.vim/vimrc
set nocompatible
set runtimepath+=/usr/local/src/neovim_minimal_stuff/denops.vim
set runtimepath+=/usr/local/src/neovim_minimal_stuff/ddu.vim
set runtimepath+=/usr/local/src/neovim_minimal_stuff/ddu-source-file
set runtimepath+=/usr/local/src/neovim_minimal_stuff/ddu-kind-file
set runtimepath+=/usr/local/src/neovim_minimal_stuff/ddu-ui-ff
set runtimepath+=/usr/local/src/neovim_minimal_stuff/ddu-commands.vim
set runtimepath+=/usr/local/src/neovim_minimal_stuff/vim-preview
filetype plugin indent on
" ddu#custom#patch_global ui: ff --- {{{
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ })
" }}}
" ddu_ff_my_settings --- {{{
autocmd FileType ddu-ff call s:ddu_ff_my_settings()
function! s:ddu_ff_my_settings() abort
nnoremap <buffer><silent> p
\ <Cmd>call ddu#ui#ff#do_action('preview')<CR>
endfunction
" }}}
" vim-preview --- {{{
noremap <silent> <A-k> :PreviewScroll -1<cr>
noremap <silent> <A-j> :PreviewScroll +1<cr>
inoremap <silent> <A-k> <c-\><c-o>:PreviewScroll -1<cr>
inoremap <silent> <A-j> <c-\><c-o>:PreviewScroll +1<cr>
" }}}
VIMRUNTIME=/usr/local/src/neovim/runtime /usr/local/src/neovim/build/bin/nvim --clean -u /usr/local/src/neovim_minimal_stuff/minimal_init.vim
Ddu file
p
-key (mapping for the preview
action) to open thewincmd k
to focus the preview windowset previewwindow?
:redir
and :message
(if errored)If this is by design, would it be possible to add the feature of scrolling the preview window while keeping the cursor-focus on the ddu-ff window?
Thx a lot and have a good one ^^
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
Related: #54
ddu-ui-ff version (SHA1): 0e889a3
denops.vim version (SHA1): 8f3899de3d3add07105221262dca90a31c4c2d4c
deno version(deno -V
output): 1.30.3
OS:
neovim/Vim :version
output: v0.8.3
if has('vim_starting')
let s:config_path = stdpath('config')
for s:repo in [
\ 'vim-denops/denops.vim',
\ 'Shougo/ddu.vim',
\ 'Shougo/ddu-ui-ff',
\ 'Shougo/ddu-kind-file',
\ 'matsui54/ddu-filter-fzy',
\ ]
let s:path = s:config_path . '/dein/repos/github.com/' . s:repo
let &g:rtp .= ',' . s:path
endfor
endif
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'uiParams': {
\ 'ff': {
\ 'split': 'floating',
\ 'filterSplitDirection': 'floating',
\ },
\ },
\ 'sourceOptions': {
\ 'ghq': {
\ 'matchers': ['matcher_fzy'],
\ },
\ },
\ })
command! Open call s:open()
function! s:open() abort
call ddu#start({
\ 'name': 'ghq',
\ 'sources': [{ 'name': 'ghq' }],
\ 'uiParams': { 'ff': { 'startFilter': v:true } },
\ 'resume': v:true,
\ })
endfunction
augroup _init_ddu
autocmd!
autocmd FileType ddu-ff call <SID>init_ddu()
autocmd FileType ddu-ff-filter call <SID>init_ddu()
augroup END
function! s:init_ddu() abort
nnoremap <buffer> <Esc> <Cmd>call ddu#ui#ff#do_action('quit')<CR>
nnoremap <buffer> q <Cmd>call ddu#ui#ff#do_action('quit')<CR>
nnoremap <buffer> <C-q> <Cmd>call ddu#ui#ff#do_action('quit')<CR>
inoremap <buffer> <C-q> <Cmd>call ddu#ui#ff#do_action('quit')<CR>
nnoremap <buffer> <CR> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
inoremap <buffer> <CR> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
nnoremap <buffer> <C-j> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
inoremap <buffer> <C-j> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
if &filetype ==# 'ddu-ff'
setl cursorline
endif
if &filetype ==# 'ddu-ff-filter'
inoremap <buffer> <C-p> <Cmd>call ddu#ui#ff#execute("call cursor(line('.')-1,0)<Bar>redraw")<CR>
inoremap <buffer> <C-n> <Cmd>call ddu#ui#ff#execute("call cursor(line('.')+1,0)<Bar>redraw")<CR>
endif
endfunction
:Open
<C-q>
:redir
and :message
(if errored)Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
An error occurs when I try to close the filter window with autoAction and startFilter set.
Close filter window without error.
ddu-ui-ff version (SHA1): ba8be0062bd67d5f4a93933600e66ece30a812cd
denops.vim version (SHA1): d7db28587bb281f9fcf56d4986e313025e250295
deno version(deno -V
output): deno 1.26.0
OS: Arch Linux
neovim/Vim :version
output:
NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser
Features: +acl +iconv +tui
See ":help feature-compile"
システム vimrc: "$VIM/sysinit.vim"
省略時の $VIM: "/usr/share/nvim"
Run :checkhealth for more info
set runtimepath^=~/plugins/denops.vim
set runtimepath^=~/plugins/ddu.vim
set runtimepath^=~/plugins/ddu-ui-ff
set runtimepath^=~/plugins/ddu-source-file_rec
set runtimepath^=~/plugins/ddu-filter-matcher_substring
set runtimepath^=~/plugins/ddu-kind-file
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'uiParams': {
\ 'ff': {
\ 'split': 'floating',
\ 'startFilter': v:true,
\ 'autoAction': {'name': 'preview'},
\ },
\ },
\ 'sources': [{'name': 'file_rec', 'params': {}}],
\ 'sourceOptions': {
\ '_': {
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ 'kindOptions': {
\ 'file': {
\ 'defaultAction': 'open',
\ },
\ }
\ })
autocmd FileType ddu-ff call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> <CR> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
nnoremap <buffer><silent> i <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
nnoremap <buffer><silent> q <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer><silent> <CR> <Esc><Cmd>close<CR>
nnoremap <buffer><silent> <CR> <Esc><Cmd>close<CR>
endfunction
call ddu#start({})
:redir
and :message
(if errored)CursorMoved Autocommands for "<buffer=2>"..function ddu#ui#ff#_do_auto_action[13]..ddu#ui#ff#do_action[13]..ddu#ui_action[1]..ddu#_request[22]..denops#request[1]..denops#server#request[6]..<SNR>17_request の処理中にエラーが検出されました:
行 1:
Error invoking 'invoke' on channel 4:
Error: Failed to call 'uiAction' with ["default","preview",{}]: Error: Failed to call 'call' with ["ddu#ui#ff#_open_preview_window",{"autoAction":{"name":"preview","params":{}},"autoResize":false,"cursorPos":-1,"displaySourceName":"no","filterFloatingPosition":"bottom","filterSplitDirection":"botright","filterUpdateTime":0,"floatingBorder":"none","highlights":{},"ignoreEmpty":false,"previewCol":0,"previewFloating":false,"previewHeight":10,"previewRow":0,"previewVertical":false,"previewWidth":40,"previewFloatingBorder":"none","previewFloatingZindex":50,"prompt":"","reversed":false,"split":"floating","splitDirection":"botright","startFilter":true,"statusline":true,"winCol":0,"winHeight":20,"winRow":0,"winWidth":0},2]: Error: Failed to call 'nvim_call_function' with ["ddu#ui#ff#_open_preview_window",[{"autoAction":{"name":"preview","params":{}},"autoResize":false,"cursorPos":-1,"displaySourceName":"no","filterFloatingPosition":"bottom","filterSplitDirection":"botright","filterUpdateTime":0,"floatingBorder":"none","highlights":{},"ignoreEmpty":false,"previewCol":0,"previewFloating":false,"previewHeight":10,"previewRow":0,"previewVertical":false,"previewWidth":40,"previewFloatingBorder":"none","previewFloatingZindex":50,"prompt":"","reversed":false,"split":"floating","splitDirection":"botright","startFilter":true,"statusline":true,"winCol":0,"winHeight":20,"winRow":0,"winWidth":0},2]]: [0,"Vim(new):E242: Can't split a window while closing another"]
at Session.call (https://deno.land/x/[email protected]/session.ts:207:13)
at async Service.call (file:///home/hyuoou/plugins/denops.vim/denops/@denops-private/service.ts:99:12)
at async Session.call (file:///home/hyuoou/plugins/denops.vim/denops/@denops-private/service.ts:166:14)
at async Session.dispatch (https://deno.land/x/[email protected]/session.ts:99:12)
at async https://deno.land/x/[email protected]/session.ts:108:18
at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
at Session.call (https://deno.land/x/[email protected]/session.ts:207:13)
at async DenopsImpl.call (file:///home/hyuoou/plugins/denops.vim/denops/@denops/impl.ts:34:12)
at async PreviewUi.previewBuffer (file:///home/hyuoou/plugins/ddu-ui-ff/denops/@ddu-ui-ff/preview.ts:194:7)
at async PreviewUi.preview (file:///home/hyuoou/plugins/ddu-ui-ff/denops/@ddu-ui-ff/preview.ts:106:14)
at async Ddu.uiAction (file:///home/hyuoou/plugins/ddu.vim/denops/ddu/ddu.ts:543:19)
at async Session.uiAction (file:///home/hyuoou/plugins/ddu.vim/denops/ddu/app.ts:233:7)
at async Session.dispatch (https://deno.land/x/[email protected]/session.ts:99:12)
at async https://deno.land/x/[email protected]/session.ts:108:18
at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
at Session.call (https://deno.land/x/[email protected]/session.ts:207:13)
at async Service.dispatch (file:///home/hyuoou/plugins/denops.vim/denops/@denops-private/service.ts:114:14)
at async Session.invoke (file:///home/hyuoou/plugins/denops.vim/denops/@denops-private/host/nvim.ts:53:16)
at async Session.dispatch (https://deno.land/x/[email protected]/session.ts:99:12)
at async https://deno.land/x/[email protected]/session.ts:108:18
at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
When I use terminal previewer with ddu-kind-file, it is unable to preview continuously.
preview contents continuously with terminal.
ddu-ui-ff version (SHA1):
denops.vim version (SHA1):
deno version(deno -V
output):
OS:
neovim/Vim :version
output:
NVIM v0.9.0-dev-1088+gd66832c76
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
" Your minimal init.vim/vimrc
set rtp+=~/.cache/dein/nvim/repos/github.com/vim-denops/denops.vim
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu.vim
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-ui-ff
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-source-file_rec
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-kind-file
nnoremap [ddu] <Nop>
nmap <Space>u [ddu]
nmap <silent> [ddu]f <Cmd>call ddu#start({
\ 'ui': 'ff',
\ 'uiParams': {
\ 'ff': {
\ 'autoAction': {
\ 'name': 'preview',
\ 'params': {
\ 'previewCmds': ['less', '+%b', '%s']
\ }
\ }
\ }
\ },
\ 'sources': [{'name': 'file_rec', 'params': {}}],
\ })<CR>
<Space>
u
f
j
for move cursor to down:redir
and :message
(if errored)I want to custom statusline of ddu-ui-ff, But it is impossible becouse feature does not exist yet.
2 features are needed to custom statuleine:
statusline
uiParams like denite's it *denite-option-statusline*
-statusline
Enable statusline.
Default: true
ddu#ui#ff#get_status()
function like deinte#get_status()
denite#get_status({name}) *denite#get_status()*
Returns the {name} part of the status string. It is useful to
customize the statusline.
Note: It also works in the Denite filter window.
The available status names:
"input": Current filtering text
"sources": Current sources and candidates number
"path": Specified |denite-option-path|
"buffer_name": Current |denite-option-buffer-name|
"line_total": Total candidates. Part of "linenr".
I have some processing that I want to execute at the same time as the filter closes. Is there any processing that is executed when the filter closes (hides)?
ddu-ui-std version (SHA1): cc8ea78
ddu.vim version (SHA1): e876d13b656a35232fa9f371a9c9cc9ba2a09f5d
denops.vim version (SHA1): e2f17041495123e8ed9baa69098c947c5d7f6358
deno version(deno -V
output): 1.18.1
OS: Mac
neovim/Vim :version
output: v0.7.0-dev+984-g2870311a3
:checkhealth
or :CheckHealth
result(neovim only): OK
I want to set the column/row position of the preview window.
Could you add previewCol
and previewRow
, like winCol
and winRow
?
or, could you fix the following problem?
If we call ddu#ui#ff#do_action('preview')
in ddu-ff
, the preview window is shown like this.
but, if we call it in ddu-ff-filter
, the preview window is shown at strange position.
NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Monterey
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'uiParams': {
\ 'ff': {
\ 'split': 'floating',
\ 'filterSplitDirection': 'floating',
\ 'prompt': '>',
\ },
\ },
...
\ })
let l:source = ... " Any source will do
call ddu#start({
\ 'name': l:source,
\ 'sources': [{ 'name': l:source }],
\ 'uiParams': { 'ff': { 'startFilter': v:true } },
\ 'resume': v:true,
\ })
What I typed | What I got |
---|---|
wb | bw |
abcdefg | gfedcba |
I could fix the problem by commenting out this line of code:
ddu-ui-ff/denops/@ddu-uis/ff.ts
Line 224 in cbd1117
With the line commented out:
Open the UI for the second time with resume: v:true
, nothing is restored — items are refreshed, the input text is gone, and the cursor position is lost.
I've confirmed that commenting out the following line fixed this problem.
ddu-ui-ff/denops/@ddu-uis/ff.ts
Line 429 in cbd1117
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
If you select it when the window is empty, you will get an error.
It also happens with other source plugins.
No error occurs when the selection operation is performed when the window is empty.
ddu-ui-std version (SHA1): ed7c2ef
ddu.vim version (SHA1): e876d13b656a35232fa9f371a9c9cc9ba2a09f5d
denops.vim version (SHA1): e2f17041495123e8ed9baa69098c947c5d7f6358
deno version(deno -V
output): 1.18.1
OS: Mac
neovim/Vim :version
output: v0.7.0-dev+978-g46bd48f7e
:checkhealth
or :CheckHealth
result(neovim only): OK
if &compatible
set nocompatible
endif
let $CACHE = expand('~/.cache')
if !isdirectory(expand($CACHE))
call mkdir(expand($CACHE), 'p')
endif
let s:dein_dir = expand('$CACHE/dein')
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
if &runtimepath !~# '/dein.vim'
if !isdirectory(s:dein_repo_dir)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir
endif
execute 'set runtimepath^=' . s:dein_repo_dir
endif
call dein#begin(s:dein_dir, expand('<sfile>'))
call dein#add('vim-denops/denops.vim')
call dein#add('Shougo/ddu.vim')
call dein#add('Shougo/ddu-commands.vim')
call dein#add('Shougo/ddu-ui-std')
call dein#add('Shougo/ddu-filter-matcher_substring')
call dein#add('Shougo/ddu-source-file_rec')
call dein#add('Shougo/ddu-kind-file')
call dein#end()
call dein#save_state()
call ddu#custom#patch_global({
\ 'ui': 'std',
\ 'sourceOptions': {
\ '_': {
\ 'matchers': ['matcher_substring'],
\ },
\ },
\ })
autocmd FileType ddu-std call s:ddu_my_settings()
function! s:ddu_my_settings() abort
nnoremap <buffer><silent> <CR>
\ <Cmd>call ddu#ui#std#do_action('itemAction')<CR>
nnoremap <buffer><silent> i
\ <Cmd>call ddu#ui#std#do_action('openFilterWindow')<CR>
nnoremap <buffer><silent> q
\ <Cmd>call ddu#ui#std#do_action('quit')<CR>
endfunction
autocmd FileType ddu-std-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer><silent> <CR>
\ <Esc><Cmd>close<CR>
nnoremap <buffer><silent> <CR>
\ <Cmd>close<CR>
endfunction
mkdir foo
cd foo
nvim
call dein#update()
call ddu#start({'sources': [{'name': 'file_rec'}]})
command.Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
Maybe just after the fix in last week, not for sure
when I execute this in EX the first time after start Neovim
:call ddu#start({})
nothing happens. and afte that, this command starts saying
[ddu] Invalid ui: "ff"
shows pop up menu
ddu-ui-ff version (SHA1):
da3ece8
denops.vim version (SHA1):
8f3899de3d3add07105221262dca90a31c4c2d4c
deno version(deno -V
output):
1.31.1
OS:
Windows 11 22H2
neovim/Vim :version
output:
v0.8.3
"init.vim for ddu-ui-ff test
let s:neovim_dir = expand('~/.config/nvim')
execute 'set runtimepath+=' . s:neovim_dir
filetype plugin indent on
syntax on
" --------------------------------------------------
"
"Directory where plugins are installed in
let s:dein_dir = expand("~/.cache/dein.vim")
let s:dein_repo_dir = s:dein_dir . '/repos'
execute 'set runtimepath+=' . s:dein_dir
execute 'set runtimepath+=' . s:dein_repo_dir
execute 'set runtimepath+=' . s:dein_repo_dir . '/github.com/Shougo/dein.vim'
execute 'set runtimepath+=' . s:dein_repo_dir . '/github.com/vim-denops/denops.vim'
execute 'set runtimepath+=' . s:dein_repo_dir . '/github.com/Shougo/ddu.vim'
execute 'set runtimepath+=' . s:dein_repo_dir . '/github.com/Shougo/ddu-ui-ff'
"Load plugins
call dein#begin(s:dein_dir)
call dein#add('vim-denops/denops.vim')
call dein#add('Shougo/ddu.vim')
call dein#add('Shougo/ddu-ui-ff')
call dein#add('Shougo/ddu-source-file')
call dein#end()
if dein#check_install()
call dein#install()
endif
call ddu#custom#patch_global(#{
\ ui: 'ff',
\ sources: [
\ #{name: 'file'},
\ ]
\})
nnoremap <buffer><silent> q <Cmd>call ddu#ui#ff#do_action('quit')<CR>
nnoremap <silent> ;h <Cmd>call ddu#start(#{sources: [#{name: 'file'}]})<CR>
execute this
:call ddu#start({})
ddu-ui-ff/denops/@ddu-uis/ff.ts
Line 561 in 76bf974
autocmd FileType ddu-ff-filter
\ nnoremap <buffer> <CR> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
Related to #63 but I have the opposite issue: I never want to resume and always want my cursor to start at the top.
ddu-ui-ff does not have a toggle for this feature currently.
I tried adding autoAction: #{name: 'noop'}
to my configuration since startFilter
+ autoAction
disables the feature. This does prevent cursor resume but adds "Invalid UI action: noop" warnings.
Not expected as such but I think a cursorResume
default-true boolean toggle would work fine!
deno -V
output):deno 1.31.1 (release, x86_64-unknown-linux-gnu)
v8 11.0.226.13
typescript 4.9.4
:version
output:NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser
Features: +acl +iconv +tui
if has('vim_starting')
let s:config_path = stdpath('cache')
for s:repo in [
\ 'vim-denops/denops.vim',
\ 'Shougo/ddu.vim',
\ 'Shougo/ddu-ui-ff',
\ 'Shougo/ddu-kind-file',
\ 'shun/ddu-source-buffer',
\ 'Shougo/ddu-filter-matcher_substring',
\ ]
let s:path = s:config_path . '/../dein/repos/github.com/' . s:repo
let &g:rtp .= ',' . s:path
endfor
endif
call ddu#custom#patch_global(#{
\ ui: 'ff',
\ volatile: v:true,
\ uiParams: #{
\ ff: #{
\ startFilter: v:true,
\ ignoreEmpty: v:false,
\ autoResize: v:false,
\ }
\ },
\ kindOptions: #{
\ file: #{
\ defaultAction: 'open',
\ },
\ },
\ sources: [
\ #{ name: 'buffer', },
\ ],
\ sourceParams: #{
\ buffer: #{
\ orderby: 'desc'
\ },
\ },
\ })
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer> <CR>
\ <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
inoremap <buffer> <Esc>
\ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
inoremap <buffer> <C-j>
\ <Cmd>call ddu#ui#ff#execute(
\ "call cursor(line('.')+1,0)<Bar>redraw")<CR>
inoremap <buffer> <C-k>
\ <Cmd>call ddu#ui#ff#execute(
\ "call cursor(line('.')-1,0)<Bar>redraw")<CR>
endfunction
nnoremap <space>b :call ddu#start(#{sources: [#{name: 'buffer'}]})<CR>
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
Commit: a4e73d0
The cursor position isn't correctly restored after resuming.
ddu-ui-ff version (SHA1): fbe319b
denops.vim version (SHA1):
deno version(deno -V
output):
OS:
neovim/Vim :version
output:
if has('vim_starting')
let s:config_path = stdpath('config')
for s:repo in [
\ 'vim-denops/denops.vim',
\ 'Shougo/ddu.vim',
\ 'Shougo/ddu-ui-ff',
\ 'Shougo/ddu-kind-file',
\ 'matsui54/ddu-filter-fzy',
\ ]
let s:path = s:config_path . '/dein/repos/github.com/' . s:repo
let &g:rtp .= ',' . s:path
endfor
endif
call ddu#custom#patch_global({
\ 'ui': 'ff',
\ 'sourceOptions': {
\ 'ghq': {
\ 'matchers': ['matcher_fzy'],
\ },
\ },
\ })
command! Open call s:open()
function! s:open() abort
call ddu#start({
\ 'name': 'ghq',
\ 'sources': [{ 'name': 'ghq' }],
\ 'uiParams': { 'ff': { 'startFilter': v:true } },
\ 'resume': v:true,
\ })
endfunction
augroup _init_ddu
autocmd!
autocmd FileType ddu-ff call <SID>init_ddu()
autocmd FileType ddu-ff-filter call <SID>init_ddu()
augroup END
function! s:init_ddu() abort
nnoremap <buffer> <Esc> <Cmd>call ddu#ui#ff#do_action('quit')<CR>
nnoremap <buffer> q <Cmd>call ddu#ui#ff#do_action('quit')<CR>
nnoremap <buffer> <C-q> <Cmd>call ddu#ui#ff#do_action('quit')<CR>
inoremap <buffer> <C-q> <Cmd>call ddu#ui#ff#do_action('quit')<CR>
nnoremap <buffer> <CR> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
inoremap <buffer> <CR> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
nnoremap <buffer> <C-j> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
inoremap <buffer> <C-j> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
if &filetype ==# 'ddu-ff-filter'
inoremap <buffer> <C-p> <Cmd>call ddu#ui#ff#execute("call cursor(line('.')-1,0)<Bar>redraw")<CR>
inoremap <buffer> <C-n> <Cmd>call ddu#ui#ff#execute("call cursor(line('.')+1,0)<Bar>redraw")<CR>
endif
endfunction
:Open
<C-q>
:redir
and :message
(if errored)**Warning: i solved the problem with minimal init.vim and no
Reproduction Instructions. **
split
to 'floating'
Only the preview window disappears and the cursor moves to the original window while the item window remains.
Either of the following
d7a15615f86830e9464c30f761a3911f619b38b3
deno -V
output):deno 1.32.5
ArchLinux
:version
output:NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3
set runtimepath^=~/.vim runtimepath+=~/.vim/after
set runtimepath+=~/.vim/plugged/denops.vim
set runtimepath+=~/.vim/plugged/ddu.vim
set runtimepath+=~/.vim/plugged/ddu-ui-ff
set runtimepath+=~/.vim/plugged/ddu-source-file
set runtimepath+=~/.vim/plugged/ddu-kind-file
set runtimepath+=~/.vim/plugged/ddu-filter-matcher_substring
let &packpath = &runtimepath
" keybind
nmap <silent> ;f <Cmd>call ddu#start(#{
\ ui: 'ff',
\ uiParams: #{
\ ff: #{
\ split: "floating",
\ highlights: {'selected': 'Statement'},
\ winCol: &columns/8 ,
\ winWidth: 15 ,
\ winRow: &lines/8,
\ winHeight: 10 ,
\ autoAction: {'name':'preview'},
\ startFilter : v:false
\ },
\ },
\ sourceOptions : #{
\ _: #{
\ matchers: ['matcher_substring']
\ }
\ },
\ sources: [#{
\ name: "file",
\ }]})<CR>
augroup DduKeyMap
au!
autocmd FileType ddu-ff call s:ddu_my_settings()
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
augroup End
function! s:ddu_my_settings() abort
" global
nnoremap <buffer><silent> <Esc>
\ <Cmd>call ddu#ui#do_action('quit')<CR>
nnoremap <buffer><silent> i
\ <Cmd>call ddu#ui#do_action('openFilterWindow')<CR>
nnoremap <buffer><silent> p
\ <Cmd>call ddu#ui#do_action('preview')<CR>
endfunction
function! s:ddu_filter_my_settings() abort
inoremap <buffer><silent> <CR> <Esc><Cmd>close<CR>
inoremap <buffer><silent> <Esc> <Esc><Cmd>close<CR>
nnoremap <buffer><silent> <CR> <Cmd>close<CR>
nnoremap <buffer><silent> <Esc> <Cmd>close<CR>
endfunction
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.