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

vim-fugitive deletes hunk summary of vim-gitgutter after updatetime passed the first time #2398

Open
schlimmchen opened this issue Jun 9, 2021 · 6 comments

Comments

@schlimmchen
Copy link

environment

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 11 2020 17:00:59)
Included patches: 1-716
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       +tcl
-autoservername    +folding           +multi_byte        +termguicolors
+balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
+browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              +perl              +title
+clientserver      +job               +persistent_undo   +toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       +lua               -ruby              +wildmenu
+dialog_con_gui    +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       +X11
+dnd               +mouse             +sound             -xfontset
-ebcdic            +mouseshape        +spell             +xim
+emacs_tags        +mouse_dec         +startuptime       +xpm
+eval              +mouse_gpm         +statusline        +xsmp_interact
+ex_extra          -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-It0QT5/vim-8.2.0716=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -Wl,-E  -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo  -lselinux  -lcanberra -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.30/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm

Installed in ~/.vim/pack/schlimmchen/start/:

  • vim-airline: 49cdcb7
  • vim-fugitive: 41960996e0c532069533072b3fd820fafe9ce0b3
  • vim-gitgutter: 0f98634b92da9a35580b618c11a6d2adc42d9f90

OS: Ubuntu 20.10
vimrc: ~/.vimrc is empty
Airline configuration: default
Terminal: gnome-terminal, $TERM=xterm-256color, t_Co=256

setup

Navigate the terminal to a git repository with unstaged changes. Open a file with unstages changes. Observe the statusline (make sure updatetime is not too low).

actual behavior

The statusline initializes with a hunk summary (0/0/0) (from vim-gitgutter?) and the branch symbol and name (from vim-fugitive):

Screenshot from 2021-06-09 14-36-01

updatetime milliseconds pass. The sign column appears (not visible in the screenshot), and the statusline has no hunk summary any more, but the branch is marked as dirty:

Screenshot from 2021-06-09 14-36-06

The cursor is moved (or any key is pressed). The hunk summary re-appears with the expected values.

Screenshot from 2021-06-09 14-36-12

expected behavior

updatetime should be small so that the gitgutter signs and the mark indicating a dirty branch are updated fast. But I am confused as to why my statusbar changes again when navigating the file after opening it. I would expect the hunk status to always be present and to be updated alongside the branch-dirty-mark the first time that updatetime milliseconds passed.

vim-figutive

When "uninstalling" vim-fugitive, the hunk summary appears with 0/0/0 values when opening the file and updates when updatetime milliseconds passed. So I guess there is some kind of incompatibility?

@chrisbra
Copy link
Member

chrisbra commented Jun 9, 2021

and what does git status show for that repository in question?

@schlimmchen
Copy link
Author

Screenshot from 2021-06-09 16-13-01

@chrisbra
Copy link
Member

chrisbra commented Jun 9, 2021

my guess is, when vim starts, it doesn't know the status so you get the clean state. Vim will however spin up some async jobs to get a correct status and my guess is you see those updated on the next redraw (e.g. when you press a key).

@schlimmchen
Copy link
Author

If vim-gitgutter is installed but vim-fugitive is not, I get the expected hunk summary +1 ~0 -0 right after the first updatetime passed, no need to press a key. There is no branch name and no dirty indicator, of course.

If vim-gitgutter is not installed but vim-fugitive is, I get no hunk summary, of course. The branch name appears immediately after opening the file and the dirty indicator appears only after moving the cursor (or pressing a key).

Reminder: If both are installed, the "default" hunk summary and branch name appear immediately, the dirty indicator appears after updatetime passed, but the correct hunk summary only re-appears after a key press.

Interesting. Can you make something of this?

@chrisbra
Copy link
Member

chrisbra commented Jun 9, 2021

I have never noticed. As I said, my guess is that this is related to the async jobs running.

@get-me-power
Copy link
Member

I have never noticed. As I said, my guess is that this is related to the async jobs running.

Also, As far as as asynchronous processing is concerned, I don't think there is anything that can be done on the vim-airline side, as some lag depends on the specs of the machine.

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

No branches or pull requests

3 participants