Shougo / pum.vim

Original popup completion menu framework library
MIT License
110 stars 19 forks source link

When the pum preview is opened, the already opened help file window is closed. #65

Closed Hot-Ori closed 5 days ago

Hot-Ori commented 6 days ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

If a candidate containing preview information is selected while the help file is open in another window, the help file window is closed as soon as the pum previewer is displayed. This only occurs in Vim and not in Neovim.

Expected

The help file window is not closed and remains open.

Environment Information (Required!)

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

syntax enable
set nocompatible
filetype plugin indent on

set runtimepath^=~/vimfiles/plugged/pum.vim
set runtimepath+=~/vimfiles/plugged/denops.vim
set runtimepath+=~/vimfiles/plugged/ddc.vim
set runtimepath+=~/vimfiles/plugged/ddc-sorter_rank
set runtimepath+=~/vimfiles/plugged/ddc-matcher_head
set runtimepath+=~/vimfiles/plugged/neco-vim
set runtimepath+=~/vimfiles/plugged/ddc-ui-pum

call ddc#custom#patch_global('sources', ['necovim'])
call ddc#custom#patch_global('sourceOptions', {
            \ '_': {'matchers': ['matcher_head'], 'sorters': ['sorter_rank'], 'preview': v:true},
            \ })

call ddc#custom#patch_global('ui', 'pum')
call ddc#custom#patch_global('autoCompleteEvents', ['InsertEnter', 'TextChangedI', 'TextChangedP'])

call pum#set_option('preview', v:true)

inoremap <C-n>  <Cmd>call pum#map#select_relative(+1)<CR>
inoremap <C-p>  <Cmd>call pum#map#select_relative(-1)<CR>
inoremap <C-y>  <Cmd>call pum#map#confirm()<CR>
inoremap <C-e>  <Cmd>call pum#map#cancel()<CR>

call ddc#enable()

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

  1. start vim
  2. open a help file window :h
  3. edit a file in another window and select a ddc candidate containing preview info (e. g. a builtin function candidate in necovim source) in insert mode.

Screen shot (if possible)

https://github.com/user-attachments/assets/d91015cb-850d-442a-9126-6927ce3f4374

Upload the log messages by :redir and :message (if errored)

Shougo commented 5 days ago

Sorry. This is feature. :help does not work in popup wndow. So pum.vim need to execute dummy :help command. It breaks current help window.

Shougo commented 5 days ago

I have fixed the problem.