Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim: scrolling of the floating preview window of CocList doesn't work #4643

Closed
monkoose opened this issue May 16, 2023 · 8 comments · Fixed by #4647
Closed

vim: scrolling of the floating preview window of CocList doesn't work #4643

monkoose opened this issue May 16, 2023 · 8 comments · Fixed by #4647
Labels
bug Something isn't working

Comments

@monkoose
Copy link
Contributor

monkoose commented May 16, 2023

EDIT: because it doesn't work in normal mode too.

Result from CocInfo

vim version: VIM - Vi IMproved 9.0 9001506
node version: v19.9.0
coc.nvim version: 0.0.82-3014125 2023-04-11 14:28:54 +0800
coc.nvim directory: /home/monkoose/.vim/pack/minpac/opt/coc.nvim
term: dumb
platform: linux

Describe the bug

In vim when "list.floatPreview": true is set it is impossible to scroll preview window with do:previewup or do:previewdown.

Reproduce the bug

Add to your coc-settings.json this code

{
  "list.floatPreview": true,
  "list.insertMappings": {
     "<C-n>": "do:previewdown",
     "<C-p>": "do:previewup"
  },
  "list.normalMappings": {
     "<C-n>": "do:previewdown",
     "<C-p>": "do:previewup"
  }
}

Open some list in insert mode that can have preview window like :CocList outline, toggle preview window and try your mappings to scroll it. Nothing happens.

@fannheyward
Copy link
Member

Yes, the scrolling of preview only works in normal mode.

@monkoose
Copy link
Contributor Author

monkoose commented May 22, 2023

Yes, the scrolling of preview only works in normal mode.

But it works just fine in insert mode when "list.floatPreview": false.

@fannheyward
Copy link
Member

Do you mean scroll the preview window with C-f?

@monkoose
Copy link
Contributor Author

monkoose commented May 22, 2023

If i'm not mistaken C-f scrolls list window itself (changing current list item). I'm talking of the preview window for the current list item location.

shows preview in floating window - preview scroll doesn't work in insert mode

{
  "list.floatPreview": true,
  "list.insertMappings": {
     "<C-n>": "do:previewdown",
     "<C-p>": "do:previewup"
  },
  "list.normalMappings": {
     "<C-n>": "do:previewdown",
     "<C-p>": "do:previewup"
  }
}

shows preview in split - preview scroll works in both modes

{
  "list.floatPreview": false,
  "list.insertMappings": {
     "<C-n>": "do:previewdown",
     "<C-p>": "do:previewup"
  },
  "list.normalMappings": {
     "<C-n>": "do:previewdown",
     "<C-p>": "do:previewup"
  }
}

Haven't tested it in neovim, only in vim it behaves as I described.

@fannheyward
Copy link
Member

fannheyward commented May 22, 2023

C-f scrolls list window itself

Yes.

From the mapping code, do:previewdown can only mapped in normal mode, will check this

this.addKeyMapping('normal', '<C-e>', 'do:previewdown')
this.addKeyMapping('normal', '<C-y>', 'do:previewup')

@fannheyward fannheyward reopened this May 22, 2023
@fannheyward
Copy link
Member

Reproduced with vim, nvim works as expected.

@fannheyward
Copy link
Member

In normal mode it is working.

Does scrolling work in normal mode with list.floatPreview = true in vim?

In my tests, when list.floatPreview = true, scrolling of the float preview didn't work in insert or normal in vim.

@monkoose
Copy link
Contributor Author

monkoose commented May 22, 2023

In normal mode it is working.

Does scrolling work in normal mode with list.floatPreview = true in vim?

In my tests, when list.floatPreview = true, scrolling of the float preview didn't work in insert or normal in vim.

Oops. Sorry for confusion. Yes it doesn't work (my config just have some general floating window scroll mappings that are mapped to <C-n> and <C-p> in normal mode), so because of this it worked in normal mode for me.
Can confirem now that it doesn't work in either mode: normal or insert.

@monkoose monkoose changed the title vim: scrolling of the preview window of CocList in insert mode doesn't work vim: scrolling of the floating preview window of CocList doesn't work May 22, 2023
fannheyward added a commit that referenced this issue May 23, 2023
Closes #4643

use `coc#float#scroll_win` to scroll float/popup window, same as hover
@fannheyward fannheyward added the bug Something isn't working label May 24, 2023
fannheyward added a commit that referenced this issue Jun 28, 2023
Closes #4643

use `coc#float#scroll_win` to scroll float/popup window, same as hover
fannheyward added a commit that referenced this issue Aug 24, 2023
Closes #4643

use `coc#float#scroll_win` to scroll float/popup window, same as hover
chemzqm pushed a commit that referenced this issue Aug 31, 2023
Closes #4643

use `coc#float#scroll_win` to scroll float/popup window, same as hover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants