Fzf: MacVIM Rendering

Created on 25 Oct 2017  路  12Comments  路  Source: junegunn/fzf

  • Category

    • [ ] fzf binary

    • [ ] fzf-tmux script

    • [ ] Key bindings

    • [ ] Completion

    • [x ] Vim

    • [ ] Neovim

    • [ ] Etc.

  • OS

    • [ ] Linux

    • [ x] Mac OS X

    • [ ] Windows

    • [ ] Windows Subsystem for Linux

    • [ ] Etc.

  • Shell

    • [x ] bash

    • [ ] zsh

    • [ ] fish

fzf 0.17.1 (brew), and MacVim 8.0 patches 1-1207

For testing, I've stripped .vimrc down to just:

call plug#begin('~/.vim/plugged')
Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf.vim'
call plug#end()

And removed .gvimrc complete

Using vim & FZF from within the terminal works perfectly. However, if I use GUI mode (i.e. mvim), the rendering of the results pane for FZF gets corrupted. It appears that the mvim rendering can't "keep up", and it fails to clear some lines, shows color encoded as ESC codes instead of the colors, etc. Screenshot attached.

I'm guessing this isn't really an FZF problem, but I'm stumped, and can't find anyone else who seems to have this problem. Is there an FZF setting I'm overlooking that will let mvim 'keep up'?

mvim-fzf

help-needed

Most helpful comment

All 12 comments

I've noticed a similar issue, although it doesn't seem to be related to color codes. It's more like the terminal view has ghosting from previous text:

screen shot 2017-10-30 at 5 21 13 pm

We'll just have to wait until the terminal feature of macvim becomes more stable and reliable.
For the time being, you'll have better experience with GUI versions of Neovim, such as VimR which I think is pretty nice (it even has a builtin markdown previewer).

@junegunn Just out of curiosity, do you believe the issue to be specifically related to the terminal feature in MacVim, or do you think it has to do with the fzf renderer?

The former, because the rendering is much more stable on the terminal emulator of Neovim.

This issue definitely lives in MacVim, you can use the script utility to confirm that the same sequence of bytes results in different results in iTerm2 and MacVim. https://github.com/macvim-dev/macvim/issues/579#issuecomment-342925823

Is there a way to disable usage of terminal in the meantime? Judging from https://github.com/junegunn/fzf/blob/master/plugin/fzf.vim#L394 there doesn't seem to be a user-configurable toggle.

Actually, it's not as important, as the alternative (launching a separate iterm) is also ugly. And you can't just run fzf like a :!command as it needs a tty. Guess we'll need to wait till :terminal gets fixed in Vim8 :(

I try FZF with VIM today, all works well. Except terminal rendering problem. Now, I know what's going on.

I haven't dug into this issue in any more depth (nor have I ever opened the source code for MacVim or fzf, so I'm by no means an expert here), but what I've noticed from living with this issue daily is:

  • The output is mangled, but the darkened line of the current selection is generally right, so you can kinda scroll through the items and choose the right one.
  • The issue seems to be timing related, because typing too quickly will cause output to get put into the input stream. You may need to backspace over the invalid input to correctly locate your file.

Great, I tested. FZF now work very well inside MacVim gui version.

Confirmed. FZF works great in MacVim as of Snapshot 146. Thank you @ichizok and @splhack!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alistaircolling picture alistaircolling  路  3Comments

ghost picture ghost  路  3Comments

chrisamow picture chrisamow  路  3Comments

ahmedelgabri picture ahmedelgabri  路  3Comments

nordlow picture nordlow  路  3Comments