antoinemadec / coc-fzf

fzf :heart: coc.nvim
390 stars 28 forks source link

Auto jump to the first line after exit from the floating window of CocFzfLocation #113

Closed gou4shi1 closed 2 years ago

gou4shi1 commented 2 years ago

Environment

Describe the Bug

If I revert https://github.com/antoinemadec/coc-fzf/commit/9fc34a66e6744f52769bb0b95cba851723964faf, this bug will disappear.

Expected Behavior

The cursor should keep in the same place before CocFzfLocation.

antoinemadec commented 2 years ago

Thanks for the debug.

Thing is this tempo is a dirty workaround. A bigger tempo might be needed in some cases depending on your plugins etc.

Could you please create a PR where the value of this tempo is 0 by default (equivalent to what is done under the if 'nvim') and when different from 0 use the value to add the tempo?

Thanks in advance!

antoinemadec commented 2 years ago

sorry, i used the word tempo instead of delay.

You could call it g:coc_fzf_location_delay

Please don't forget to update the documentation

gou4shi1 commented 2 years ago

I found that

autocmd User CocLocationsChange nested call timer_start(0, 'CocFzfLocationsVimRun')

can also solve this issue.

gou4shi1 commented 2 years ago

A bigger tempo might be needed in some cases depending on your plugins etc.

So the root cause is other plugin?

antoinemadec commented 2 years ago

I don't wanna use timer_start if it's not needed.

I don't know exactly what is causing this behavior. Used to happen all the time with no other plugins than this one. Then it was fixed, then broken again apparently...