sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.9k stars 164 forks source link

Fresh install on vim breaks with `let g:gruvbox_material_better_performance = 1` #187

Closed yatesco closed 10 months ago

yatesco commented 10 months ago

I have done the following steps before reporting this issue:

Operating system/version

macOS 14.1.1 (23B81)

Terminal emulator/version

macOS Terminal

$TERM environment variable

xterm-256color

Tmux version

No response

Feature matrix

➜  ~ vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 30 2023 05:45:19)
macOS version - x86_64
Included patches: 1-1894
Compiled by root@apple.com
Normal 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
+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: "$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: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework Cocoa      

Minimal vimrc that can reproduce this bug.

packadd! gruvbox-material
" Important!!
if has('termguicolors')
  set termguicolors
endif

" For dark version.
set background=dark

" For light version.
" set background=light

" Set contrast.
" This configuration option should be placed before `colorscheme gruvbox-material`.
" Available values: 'hard', 'medium'(default), 'soft'
let g:gruvbox_material_background = 'soft'

" For better performance 
let g:gruvbox_material_better_performance = 1

colorscheme gruvbox-material

Steps to reproduce this bug using minimal vimrc

  1. create empty .vim
  2. clone/add submodule: git submodule add --depth=1 https://github.com/sainnhe/gruvbox-material.git pack/colors/opt/gruvbox-material
  3. start vim

Expected behavior

lovely gruvbox colours

Actual behavior

nothing until you press Ctrl-C at which point the following appears:

➜  ~ vim .vim/vimrc
^CError detected while processing /Users/coliny/.vim/vimrc[21]../Users/coliny/.vim/pack/colors/opt/gruvbox-material/colors/gruvbox-material.vim:
line 1423:
Interrupted
Error detected while processing /Users/coliny/.vim/vimrc:
line   21:
Interrupted
Interrupt: Press ENTER or type command to continue

NOTE: removing let g:gruvbox_material_better_performance = 1 makes everything work.

antoineco commented 10 months ago

I just tried in a fresh Debian container using this exact .vimrc and plugin (pack) cloned into the same location.

It took Vim a couple of seconds to generate the syntax files on the first startup, but it eventually completed:

root@6da86b42c634:~# vim
[gruvbox-material] Generated /root/.vim/pack/colors/opt/gruvbox-material/after/syntax
Press ENTER or type command to continue
root@6da86b42c634:~# ls ~/.vim/pack/colors/opt/gruvbox-material/after/syntax/
NeogitCommitView  dirvish          less      perl        tagbar
NeogitStatus      dosini           lisp      php         tex
NvimTree          elixir           lua       pod         text
Outline           erlang           make      ps1         toml
aerial            fern             markdown  purescript  typescript
c                 fish             matlab    python      typescriptreact
clojure           gitcommit        moon      quickmenu   undotree
cmake             go               neo-tree  rst         vim
coc-explorer      haskell          nerdtree  ruby        vim-plug
coctree           help             netrw     rust        vimwiki
coffee            html             objc      sass        vista
cpp               java             objcpp    scala       vista_kind
cs                javascript       ocaml     scss        vista_markdown
css               javascriptreact  octave    sh          xml
dart              json             octo      startify    yaml
dashboard         kotlin           packer    swift       zsh

After starting Vim, could you please keep checking, in a separate terminal, whether the contents of the ~/.vim/pack/colors/opt/gruvbox-material/after/syntax/ directory is being populated?

yatesco commented 10 months ago

Ah OK - I wasn't waiting long enough. Yes, letting it finish (few seconds) works perfectly. Thanks!

antoineco commented 10 months ago

Glad it completed eventually!

yatesco commented 10 months ago

https://github.com/sainnhe/gruvbox-material/pull/188 if you want it :-)