itchyny/lightline.vim

Status line occasionally breaks when opening directories in netrw

sstallion opened this issue · 4 comments

Hello! I've noticed in somewhat recent builds of vim on both Linux and macOS (eg. VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 29 2022 22:45:51) the status line will break when opening a directory from netrw. This isn't 100% reliable, but it can be reproduced fairly easily:

  1. Edit the current directory (eg. :e .)
  2. Navigate to a directory and press return
  3. The status bar should revert to the system styling
  4. Repeat

This does not seem to affect files and only seems to trigger if when using netrw.

Please attach the output of vim --version, reproducible vimrc, and screenshot of the issue.

Sure thing! I've noticed that this is much easier to reproduce if I create an empty directory, change into it and issue vim .

Vim Version

% vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 29 2022 22:45:51)
Included patches: 1-4328
Modified by Gentoo-8.2.4328-r1
Compiled by portage@localhost
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     -perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby              +wildignore
+cursorbind        -lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      +sodium            +X11
+digraphs          +mouse             -sound             +xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        +mouse_gpm         +statusline        +xsmp_interact
+eval              -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static
   system vimrc file: "/etc/vim/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: x86_64-pc-linux-gnu-gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=native -O2 -pipe -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: x86_64-pc-linux-gnu-gcc -L. -Wl,-O1 -Wl,--as-needed -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-O1 -Wl,--as-needed -L/usr/local/lib -o vim -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lsodium -lacl -lattr -lgpm -lpython3.9 -ldl -lm -lm -lruby27 -lm -L/usr/lib64

.vimrc

set nocompatible

execute pathogen#infect()
execute pathogen#helptags()

set laststatus=2

Screenshot

Screenshot from 2022-07-11 21-40-32

Looks like a duplicate issue of #390. Workaround is posted there.

Looks good. Thanks!