Shougo / ddu-ui-ff

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

Problems with resume option #18

Closed creasty closed 2 years ago

creasty commented 2 years ago
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,
\ })

Problem 1: Letters typed into the filter window gets rearranged in reverse

What I typed What I got
wb bw
abcdefg gfedcba

https://user-images.githubusercontent.com/1695538/157854457-4adab908-a8dd-4742-a17e-97639afb0c67.mov

I could fix the problem by commenting out this line of code:

https://github.com/Shougo/ddu-ui-ff/blob/cbd1117d134195cf7848451dc1844178e543aa68/denops/%40ddu-uis/ff.ts#L224

With the line commented out:

https://user-images.githubusercontent.com/1695538/157855624-b112facd-0faf-4446-b395-c40ec1314b7a.mov

Problem 2: The previous state not being properly restored

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.

https://github.com/Shougo/ddu-ui-ff/blob/cbd1117d134195cf7848451dc1844178e543aa68/denops/%40ddu-uis/ff.ts#L429

Shougo commented 2 years ago

Fixed. Please update ddu.vim

creasty commented 2 years ago

Much obliged šŸ‘