junegunn / vim-peekaboo

:eyes: " / @ / CTRL-R
1.12k stars 38 forks source link

vim-peekaboo sets cmdheight to max, meaning I can only see 1 line of my window output #83

Open gibfahn opened 1 year ago

gibfahn commented 1 year ago

Originally raised at https://github.com/neoclide/coc.nvim/issues/4178#issuecomment-1243592457. I also saw https://github.com/junegunn/vim-peekaboo/issues/74, but I'm not 100% sure that's the same issue.

Describe the bug

When I apply a macro, the cmdheight gets set to the max, so that I can only see one line of the output.

Reproduce the bug

Plugins:

This reproduces for me on my laptop screen.

export tmp=$TMPDIR/nvim_4178
rm -rf "$tmp"
export XDG_DATA_HOME=$tmp/xdg_data_home
export XDG_CONFIG_HOME=$tmp/xdg_config_home
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
echo "
set nocompatible
set runtimepath^=/path/to/coc.nvim
filetype plugin indent on
syntax on
set hidden

call plug#begin()
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'junegunn/vim-peekaboo'
call plug#end()
" >"$tmp/mini.vim"
curl -o "$tmp/CONTRIBUTING.md" https://raw.githubusercontent.com/Homebrew/brew/master/CONTRIBUTING.md
nvim -es -u "$tmp/mini.vim" -i NONE -c "PlugInstall" -c "qa"
nvim -u $tmp/mini.vim -c "CocInstall -sync coc-markdownlint|qa"
nvim -u "$tmp/mini.vim" "$tmp/CONTRIBUTING.md"

When you get the contributing.md open, press w till you get to the / of the .github/ and then type:

And you should be left with 1 line at the top of the screen (and set cmdheight? should return something like 54).

I mostly hit this while applying a macro that uses a register, but this seems like an easier reproduction.

I think the key is to open the window on a long line, so that the wrapping of the text changes when the peekaboo window opens/closes.

Screenshots (optional)

image

The reason is vim-peekaboo create bad winrestcmd at junegunn/vim-peekaboo@cc4469c/autoload/peekaboo.vim#L61, it doesn't consider float window which fired BufEnter before.

hnandiwada commented 1 year ago

+1

jackielii commented 1 year ago

I think it's dup of #74

gibfahn commented 1 year ago

I think it's dup of #74

Yeah I believe so too, but filed a new issue as I'm not 100% sure. See https://github.com/junegunn/vim-peekaboo/issues/74#issuecomment-1242951822

junegunn commented 1 year ago

I currently don't have the bandwidth to look into this problem (it's not affecting my workflow), please send a pull request and I'll be happy to merge it.

gibfahn commented 2 weeks ago

Got round to opening a PR: https://github.com/junegunn/vim-peekaboo/pull/89