liuchengxu/space-vim-dark

colorscheme broken after last commit

jgb opened this issue · 5 comments

jgb commented

Hello,

when I start gvim I get this error, which started to appear since the last commit:

Error detected while processing function 20_hi:
line 2:
E716: Key not present in Dictionary: 5
E116: Invalid arguments for function get(s:colors, a:bg, s:color256[a:bg]))
E116: Invalid arguments for function printf('ctermbg=%d guibg=%s', a:bg, get(s:colors, a:bg, s:color256[a:bg]))
E15: Invalid expression: empty(a:bg) ? '' : printf('ctermbg=%d guibg=%s', a:bg, get(s:colors, a:bg, s:color256[a:bg]))
line 4:
E121: Undefined variable: l:bg
E15: Invalid expression: 'hi '.a:item.' '.l:fg.' '.l:bg.' '.l:style

Hi, I have just tested the latest version in gvim. It works well. Can you please provide more information, e.g., :version?

jgb commented

Strange! I'm using vim supplied by debian (https://packages.debian.org/buster/vim-gtk)

:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 25 2017 02:02:28)
Included patches: 1-1144
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version with GTK2 GUI. Features included (+) or not (-):
+acl +cmdline_hist -ebcdic +gettext +listcmds +mouse_sgr +persistent_undo +smartindent +termresponse +wildignore
+arabic +cmdline_info +emacs_tags -hangul_input +localmap -mouse_sysmouse +postscript +startuptime +textobjects +wildmenu
+autocmd +comments +eval +iconv +lua +mouse_urxvt +printer +statusline +timers +windows
+balloon_eval +conceal +ex_extra +insert_expand +menu +mouse_xterm +profile -sun_workshop +title +writebackup
+browse +cryptv +extra_search +job +mksession +multi_byte -python +syntax +toolbar +X11
++builtin_terms +cscope +farsi +jumplist +modify_fname +multi_lang +python3 +tag_binary +user_commands -xfontset
+byte_offset +cursorbind +file_in_path +keymap +mouse -mzscheme +quickfix +tag_old_static +vertsplit +xim
+channel +cursorshape +find_in_path +lambda +mouseshape +netbeans_intg +reltime -tag_any_white +virtualedit +xpm
+cindent +dialog_con_gui +float +langmap +mouse_dec +num64 +rightleft +tcl +visual +xsmp_interact
+clientserver +diff +folding +libcall +mouse_gpm +packages +ruby +termguicolors +visualextra +xterm_clipboard
+clipboard +digraphs -footer +linebreak -mouse_jsbterm +path_extra +scrollbind +terminal +viminfo -xterm_save
+cmdline_compl +dnd +fork() +lispindent +mouse_netterm +perl +signs +terminfo +vreplace
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-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/incl
ude/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16
-I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -Wdate-time
-g -O2 -fdebug-prefix-map=/build/vim-fz2Miv/vim-8.0.1144=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -lpa
ngocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE
-lm -ltinfo -lnsl -lselinux -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.26/CORE -lperl -l
dl -lm -lpthread -lcrypt -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lieee -l
m -lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm

Hmm, I'm using Windows gvim :(. The latest version works well in both Windows gvim and macvim.

The error message is really confusing. 5 should never be used. I have no clue for now, see if this helps:

Add the two lines to s:color256

let s:color256 = {
      \ 0: '#000000',  1 : '#800000',  2: '#008000',  3: '#808000',  4: '#000080',  5: '#800080',  6: '#008080' , 7 : '#c0c0c0',
      \ 8: '#808080',  9 : '#ff0000', 10: '#00ff00', 11: '#ffff00', 12: '#0000ff', 13: '#ff00ff', 14: '#00ffff', 15: '#ffffff',
...
jgb commented

That fixes the errors indeed!

Thanks, @jgb . I have patched the plugin based on your feedback. Please update to the latest version, then you are free to discard your local change.