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

Redraw the window for the insert mode #38

Closed
wants to merge 1 commit into from
Closed

Conversation

110y
Copy link

@110y 110y commented May 26, 2023

I found that pum.vim now only shows the first page of completion candidates even if we try to scroll down the page when we have candidates more than max_height in the Insert mode. If my investigation is correct, it's because this change makes pum.vim redraw the screen only if the current mode is Command-line.
So, this PR makes pum.vim redraw the screen even if the current mode is Insert in addition to Command-line.

@Shougo
Copy link
Owner

Shougo commented May 27, 2023

I get it. The redraw is needed for Vim.

Please report your environment in the first.

@Shougo Shougo closed this in 891fcc5 May 27, 2023
@Shougo Shougo added the vim Vim specific problem label May 27, 2023
@110y
Copy link
Author

110y commented May 27, 2023

@Shougo

Thank you for taking a look at this PR!

Please report your environment in the first.

Sorry about that, my environment is:

  • Linux - AMD64
  • NeoVim (current master branch: d3a22ff24)
  • pum.vim (current main branch: 891fcc575)
  • ddc.vim (current main branch: db28c7d)
  • ddc-ui-pum (current main branch: e8eb779)

As I use Neovim, I think this change that only redraws for Vim does not solve the problem.

So, now I'm trying to create the minimal configuration for the problem to reproduce this problem...

@Shougo
Copy link
Owner

Shougo commented May 27, 2023

My neovim enviroment, it works. You need to create minimal init.vim.

@110y
Copy link
Author

110y commented May 27, 2023

@Shougo

Now it can be reproduced with the minimal configuration below.
It seems that this problem happens when we set the empty string to scrollbar_char in order to disable the scroll bar.

Prerequisites

$ mkdir tmp
$ git clone https://github.com/Shougo/pum.vim ./tmp/pum.vim # revision: 891fcc5
$ git clone https://github.com/Shougo/ddc.vim ./tmp/ddc.vim # revision: db28c7d
$ git clone https://github.com/Shougo/ddc-ui-pum ./tmp/ddc-ui-pum # revision: e8eb779
$ git clone https://github.com/Shougo/ddc-source-around.git ./tmp/ddc-source-around # revision: e119de9
$ git clone https://github.com/Shougo/denops.vim ./tmp/denops.vim # 949a524

NeoVim version

NVIM v0.10.0-dev-1100+gb3961a1e7
Build type: Release
LuaJIT 2.1.0-beta3

Configuration

set runtimepath+=$PWD/tmp/denops.vim
set runtimepath+=$PWD/tmp/pum.vim
set runtimepath+=$PWD/tmp/ddc.vim
set runtimepath+=$PWD/tmp/ddc-ui-pum
set runtimepath+=$PWD/tmp/ddc-source-around

call ddc#custom#patch_global('ui', 'pum')

call ddc#custom#patch_global('sources', ['around'])

call ddc#custom#patch_global('sourceOptions', {
      \   'around': { 'mark': 'A' },
      \ })
call ddc#custom#patch_global('sourceParams', {
      \   'around': { 'maxSize': 500 },
      \ })

call pum#set_option({
            \   'max_height': 5,
            \   'scrollbar_char': '',
            \ })

inoremap <C-n> <Cmd>call pum#map#insert_relative(+1)<CR>
inoremap <C-p> <Cmd>call pum#map#insert_relative(-1)<CR>

call ddc#enable()

Procedure

  1. nvim ./tmp/pum.vim/doc/pum.txt
  2. type o to create a new line
  3. type pu to open the completion window
  4. type C-n six times to scroll the completion window
  5. then, this problem should be reproduced (the completion window is not updated to include expected candidates)

So, it may be pum.vim should redraw the window even if the current mode is Insert when we disable the scroll bar?
I appreciate it if you could take another look, thank you!

@Shougo
Copy link
Owner

Shougo commented May 27, 2023

OK. Reproduced and I have fixed.

@110y 110y deleted the redraw branch May 28, 2023 01:34
@110y
Copy link
Author

110y commented May 28, 2023

Now it works as expected, thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vim Vim specific problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants