我在笔记本电脑上使用Quramy/tsuquyomi
插件,一切运行良好。今天我把它安装在我的桌面上(macOS Sierra与笔记本电脑上的相同),我在启动vim时遇到错误:
Error detected while processing /Users/username/.vim/bundle/tsuquyomi/plugin/tsuquyomi.vim:
line 38:
E806: using Float as a String
E116: Invalid arguments for function get(g:, 'tsuquyomi_waittime_after_open', 0.01)
E15: Invalid expression: get(g:, 'tsuquyomi_waittime_after_open', 0.01)
Press ENTER or type command to continue
我比较了vim --version
的输出,看起来一切都是一样的。
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 3 2017 18:35:35)
MacOS X (unix) version
Included patches: 1-1050
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminal
++builtin_terms +fork() +multi_lang +terminfo
+byte_offset -gettext -mzscheme +termresponse
+channel -hangul_input +netbeans_intg +textobjects
+cindent +iconv +num64 +timers
-clientserver +insert_expand +packages +title
+clipboard +job +path_extra -toolbar
+cmdline_compl +jumplist +perl +user_commands
+cmdline_hist +keymap +persistent_undo +vertsplit
+cmdline_info +lambda +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con -lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape +startuptime -xpm
+eval +mouse_dec +statusline -xsmp
+ex_extra -mouse_gpm -sun_workshop -xterm_clipboard
+extra_search -mouse_jsbterm +syntax -xterm_save
+farsi +mouse_netterm +tag_binary
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/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lncurses -liconv -framework Cocoa -mmacosx-version-min=10.12 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.26.0/lib/perl5/5.26.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/usr/local/opt/python/Frameworks -framework Python -lruby.2.4.1 -lobjc
另外,我确认Quramy/tsuquyomi
的版本与笔记本电脑上的版本相同。
有没有人知道如何修复这些错误?
答案 0 :(得分:1)
好的,所以问题出在浮点数上:
get(g:, 'tsuquyomi_waittime_after_open', 0.01)
虽然构建中包含插件+float
,但仍会出现错误。要修复,您只需使用str2float("0.01")
替换所有浮点数:
get(g:, 'tsuquyomi_waittime_after_open', str2float("0.01"))
此外,我发布了拉取请求,似乎已合并更改:https://github.com/Quramy/tsuquyomi/pull/178