junegunn / fzf.vim

fzf :heart: vim
MIT License
9.59k stars 582 forks source link

Weird glitch in popup window #1370

Closed ckangnz closed 2 years ago

ckangnz commented 2 years ago

I always had this weird glitch when rendering the popup window on fzf, where the window spazzes whenever it opens. I thought it was due to too many files being loaded onto fzf finder.

But today i realised that there is a weird behaviour on my popup.

ezgif-1-30a8cc03ac

As shown in the screenshot, there are only 3 outcomes, but the popup still makes a weird glitch. Then I realised that popup window on the right side had a broken UI. When I toggle open the preview window, it is more evident.

image

I tried removing all other plugins and removed all of my settings except fzf, but couldn't remove this issue.

here is the minimum settings

".plugins
filetype off                  " required

call plug#begin('~/.vim/plugged')

Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'                                             " Fuzzy find files/content/tags
Plug 'neoclide/coc.nvim', {'branch': 'release', 'do': ':CocUpdate'}
"Plug 'antoinemadec/coc-fzf'                                         " Fzf for coc

call plug#end()

"-----------------------------------

".vimrc
"junegunn/fzf
set rtp+=~/.fzf
let $FZF_DEFAULT_OPTS="--layout=reverse --bind ctrl-k:preview-up,ctrl-j:preview-down,?:toggle-preview"
let $FZF_DEFAULT_COMMAND='rg --files --follow --no-ignore-vcs --hidden -g "!{node_modules/*,.git/*}"'
let g:fzf_layout={'window':{ 'width': 0.9, 'height': 0.6 }}
let g:fzf_preview_window = []
let g:fzf_action = {
            \ 'ctrl-t': 'tab split',
            \ 'ctrl-o': 'split',
            \ 'ctrl-v': 'vsplit' }
command! Ctrlp execute (exists("*fugitive#head") && len(fugitive#head())) ? ':GFiles' : ':Files'
nnoremap <silent> <C-p> :Ctrlp<CR>
nnoremap <silent> <C-e> :History<CR>
nnoremap <silent> <C-t> :Tags<CR>
nnoremap <Leader>f :Rg<space>
vnoremap <Leader>f y:Rg <c-r>"<cr>
nnoremap <Leader>F :Rg <c-r><c-w><cr>

autocmd! FileType fzf
autocmd! FileType fzf tnoremap <buffer> <esc> <c-c>
autocmd  FileType fzf set laststatus=0 noshowmode noruler
  \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
junegunn commented 2 years ago

What is the output of :echo &ambiwidth?

ckangnz commented 2 years ago

@junegunn single

junegunn commented 2 years ago

Is your terminal emulator capable of properly displaying box-drawing characters?

cat << EOF
╭─────────────────────────────────────────────────────╮
│                                                     │
│ https://en.wikipedia.org/wiki/Box-drawing_character │
│                                                     │
╰─────────────────────────────────────────────────────╯
EOF
ckangnz commented 2 years ago

@junegunn I've just tested on my terminal (iterm2) and it doesn't show broken side bar, but it still shows glitches. It looks like the bar glitch is only present on macvim (v 8.2.3455 )

asdfsd

The gif shows vim first then mvim in comparison.

vim does not have the popup UI defect, but still has the glitch. mvim has popup UI defect, and also has the glitch.

ckangnz commented 2 years ago

@junegunn should this be reported to macvim you reckon?

junegunn commented 2 years ago

I currently don't have macvim installed to confirm the case. You might want to open a terminal inside macvim (:terminal) and run the above command I showed you and see if it properly displays the box.

If it doesn't, I would try changing the font of macvim to see if it helps. Or you could add let $FZF_DEFAULT_OPTS='--no-unicode' to your Vim configuration file so that fzf doesn't use unicode box-drawing chars.

ckangnz commented 2 years ago

@junegunn thank you! i guess the issue was from my font? Entering :terminal in macvim also showed the similar issues only on macvim terminal. I added --no-unicode and it fixed the issue. Looks slightly uglier than before but looks more like vim style anyways :)

it hasn't solved the flickering issue, but the UI looks much better now.

Do you know what could be causing the flickering btw?