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

Powerline causes flickering in vim. #1281

Closed
person808 opened this issue Jan 22, 2015 · 13 comments
Closed

Powerline causes flickering in vim. #1281

person808 opened this issue Jan 22, 2015 · 13 comments

Comments

@person808
Copy link

After opening a file with vim I can scroll flicker-free. When I open another file, or even another buffer like Unite, vim starts to flicker when switching files and scrolling. Repeated switching makes the flickering worse. Sometimes, I can't even see text until I stop scrolling.

vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 14 2015 20:16:36)
Included patches: 1-580
Compiled by Arch Linux
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl             -ebcdic          +localmap        +printer         +title
+arabic          +emacs_tags      +lua             +profile         +toolbar
+autocmd         +eval            +menu            +python          +user_commands
+balloon_eval    +ex_extra        +mksession       -python3         +vertsplit
+browse          +extra_search    +modify_fname    +quickfix        +virtualedit
++builtin_terms  +farsi           +mouse           +reltime         +visual
+byte_offset     +file_in_path    +mouseshape      +rightleft       +visualextra
+cindent         +find_in_path    +mouse_dec       +ruby            +viminfo
+clientserver    +float           +mouse_gpm       +scrollbind      +vreplace
+clipboard       +folding         -mouse_jsbterm   +signs           +wildignore
+cmdline_compl   -footer          +mouse_netterm   +smartindent     +wildmenu
+cmdline_hist    +fork()          +mouse_sgr       -sniff           +windows
+cmdline_info    +gettext         -mouse_sysmouse  +startuptime     +writebackup
+comments        -hangul_input    +mouse_urxvt     +statusline      +X11
+conceal         +iconv           +mouse_xterm     -sun_workshop    -xfontset
+cryptv          +insert_expand   +multi_byte      +syntax          +xim
+cscope          +jumplist        +multi_lang      +tag_binary      +xsmp_interact
+cursorbind      +keymap          -mzscheme        +tag_old_static  +xterm_clipboard
+cursorshape     +langmap         +netbeans_intg   -tag_any_white   -xterm_save
+dialog_con_gui  +libcall         +path_extra      -tcl             -xpm
+diff            +linebreak       +perl            +terminfo
+digraphs        +lispindent      +persistent_undo +termresponse
+dnd             +listcmds        +postscript      +textobjects

Terminal is gnome terminal.

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 22, 2015

What is your configuration? Are some of those files version-controlled?

You can use profiling to get the results:

vim --cmd 'let g:powerline_pyeval="powerline#debug#profile_pyeval"' \
    --cmd 'set rtp+=/path/to/powerline/repository/powerline/bindings/vim' \
    {other arguments if needed}

. After doing some splitting and experiencing performance issues for some time do :WriteProfiling /tmp/profile and post the written file here (make sure not to have any passwords in your powerline configuration, like password for email_imap_alert segment, I am not sure they are not saved).

Possibly related: #1280.

@person808
Copy link
Author

What is your configuration?

I am using the default powerline configuration for vim.

I also made a minimal .vimrc:

call plug#begin('~/.vim/plugged')                                                                   
Plug 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'}
Plug 'w0ng/vim-hybrid'
call plug#end()

set nocp
set shell=bash
set cursorline
set laststatus=2
set showtabline=2
set t_Co=256
let g:hybrid_use_Xresources = 1
colorscheme hybrid
let mapleader=","
nnoremap <Leader>l :bnext<CR>
nnoremap <Leader>h :bprevious<CR>

Note: The flickering is less severe compared to my full .vimrc, but I can still get the bottom quarter of the buffer to flicker. At one point I scrolled down to the bottom a file and held j and powerline began flickering by itself.

Are some of those files version-controlled?

If you mean the files I opened, I was able to reproduce the issue regardless of if the files were in a repo.

/tmp/profile
http://hastebin.com/yuxizebiki.md

@person808
Copy link
Author

Problem also occurs in vim with +python3

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 23, 2015

/tmp/profile
http://hastebin.com/yuxizebiki.md

Unknown domain. Also note that /tmp/profile is a binary file. I do not think pastebin variations are right way to post it, not unless you use base64 encoding or the like.

@person808
Copy link
Author

Would a Google Drive link be better?

https://drive.google.com/open?id=0B16rp5cev5IDVVRXVlVsb2E5dWc&authuser=0

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 23, 2015

I also made a minimal .vimrc:

I am wondering does this mean that colorscheme is relevant? (I.e. removing it resolves the issue?)


I was able to download and use profile file, but cannot seem to find anything bad there so far.

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 23, 2015

I guess I need to make it possible to start profiling at some point, not from the very begginning.

You said that problems start after you open another buffer. How much time did you spend with problems compared to time without problems when preparing profiling? Does setting showtabline=1 fix it?

Also note that powerline with profiling enabled is a wrong way to determine minimal vimrc (in case you did it this way, I do not know): enabled profiling is causing performance degradation on its own.

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 23, 2015

Oh, no, I do see something unusual: you have too much calls to get_segments/process_segments. I am wondering if problem is still present if you add

let g:powerline_config_overrides={'common': {'reload_config': 0}}

to the vimrc (this requires vim-7.4 or higher to work properly).

@person808
Copy link
Author

I am wondering does this mean that colorscheme is relevant?

No, the colorscheme does not matter. Removing it did not affect the flickering.

let g:powerline_config_overrides={'common': {'reload_config': 0}}

Adding that to my regular .vimrc did not help with the flickering but setting showtabline=1 did solve the flickering. I'll try a different tabline replacement for now until this can be fixed.

@kubahorak
Copy link

I have the same problem. I use the bufferline inside the tabline, so I set showtabline=2 to have it always visible.
If I press CTRL+Z in Bash to suspend Vim and then do fg to restore it, the flickering is gone. However after a while it starts to flicker again.
Setting showtabline=1 solves the flickering, but obviously it also hides the tabline.

@tomphp
Copy link

tomphp commented Aug 10, 2015

I have the same thing, showtabline=1 fixes it, but crazy flickering with showtabline=2.

An interesting point though, there's no flickering if I run it inside of tmux.

@0decimal0
Copy link

I am facing this issue of vim flickering after using powerline. Although gvim is out of this problem , the oringinal vim inside terminal is flickering. I used showtabline=1 but it was useless. It is kind of frustrating .

@0decimal0
Copy link

I solved it. I had set lines and columns to 999 and since I was opening vim inside a tmux pane of 80x24 it was not possible so I just removed the line set lines=999 columns=999 and everything is sane now. VIM is working flawlessly.

@ZyX-I ZyX-I closed this as completed in 6efabc1 Nov 15, 2015
ZyX-I pushed a commit to ZyX-I/powerline that referenced this issue Feb 16, 2016
vim_getbufoption(segment, 'buflisted') was causing vim to update the tabline for every
keystroke. using vim.eval('buflisted(nr)') allows vim to optimize when
it needs to update

Fixes powerline#1281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants