Shougo / ddu-ui-ff

Fuzzy finder UI for ddu.vim
MIT License
55 stars 26 forks source link

Incorrect selection target when selecting candidates #126

Closed hokorobi closed 1 year ago

hokorobi commented 1 year ago

Problems summary

If reversed: v:true is set, the selection appears to be reversed.

Expected

The intended selection target can be selected.

Environment Information

Provide a minimal init.vim/vimrc without plugin managers (Required!)

set nocompatible
let $path .= ';' .. '~/.deno/bin'
set runtimepath+=C:\Users\hokorobi\_vim\dein\repos\github.com\vim-denops\denops.vim
set runtimepath+=C:\Users\hokorobi\_vim\dein\repos\github.com\Shougo\ddu.vim
set runtimepath+=C:\Users\hokorobi\_vim\dein\repos\github.com\Shougo\ddu-ui-ff
set runtimepath+=C:\Users\hokorobi\_vim\dein\repos\github.com\Shougo\ddu-kind-file
set runtimepath+=C:\Users\hokorobi\_vim\dein\repos\github.com\Shougo\ddu-filter-matcher_substring
set runtimepath+=C:\Users\hokorobi\_vim\dein\repos\github.com\Shougo\ddu-source-file

call ddu#custom#patch_global(#{
    \   ui: 'ff',
    \   kindOptions: #{
    \     file: #{
    \       defaultAction: 'open',
    \     },
    \   },
    \   sourceOptions: #{
    \     _: #{
    \       ignoreCase: v:true,
    \       matchers: ['matcher_substring'],
    \     },
    \   },
    \   sources: [#{name: 'file', params: {}}],
    \   uiParams: #{
    \     ff: #{
    \       startFilter: v:true,
    \       autoResize: v:true,
    \       reversed: v:true,
    \       split: 'no',
    \     }
    \   },
    \ })
autocmd Filetype ddu-ff nnoremap <buffer><silent> <CR> <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
autocmd Filetype ddu-ff nnoremap <buffer><silent> q <Cmd>call ddu#ui#ff#do_action('quit')<CR>
autocmd Filetype ddu-ff nnoremap <buffer><silent><nowait> <Space> <Cmd>call ddu#ui#do_action('toggleSelectItem')<CR>
autocmd Filetype ddu-ff-filter inoremap <buffer><silent> <CR> <Esc><Cmd>close<CR><Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
autocmd Filetype ddu-ff-filter nnoremap <buffer><silent> <CR> <Cmd>close<CR>
autocmd Filetype ddu-ff-filter nnoremap <buffer><silent> <Esc> <Cmd>close<CR>
autocmd Filetype ddu-ff-filter inoremap <buffer><silent><expr> <Esc>
      \ col('.') > 1 ? "<Esc><Cmd>call ddu#ui#do_action('closeFilterWindow')<CR>" :
      \ "<Esc><Cmd>call ddu#ui#do_action('quit')<CR>"

filetype plugin indent on
syntax enable

How to reproduce the problem from neovim/Vim startup (Required!)

  1. gvim -N -u ~/vimfiles/minimal-vimrc -U NONE -i NONE
  2. :call ddu#start(#{name: 'file'})
  3. Input ftplug -> ESC -> kk -> Space

Screenshot (if possible)

The video is cut off, but :call ddu#start(#{name: 'file'}) is executed.

https://github.com/Shougo/ddu-ui-ff/assets/99910/fed4c8d4-d0c9-4443-a68b-f48e219589b4

Shougo commented 1 year ago

Fixed.

hokorobi commented 1 year ago

Thank you! The selection target has been improved, but the cursor position when selecting seems to move to the row that was originally selected.

Shougo commented 1 year ago

It is the latest version? I was fixed.

hokorobi commented 1 year ago

My apologies, no problem. It seems that Deno's cache was working.