Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Log to a specific gopls logfile * Only do ftplugin-based configuration once govim has loaded * Prevent race condition on autocmd events possibly being handled before govim is initcomplete * Use Vim's execute() function instead of our own terrible function * Put in a hacky fix for local-aware version parsing; add a test for a non-English version string
- Loading branch information
Showing
5 changed files
with
75 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
setlocal balloonexpr=GOVIM_internal_BalloonExpr() | ||
setlocal omnifunc=GOVIM_internal_Complete | ||
nnoremap <buffer> <silent> gd :GOVIMGoToDef<cr> | ||
nnoremap <buffer> <silent> <C-]> :GOVIMGoToDef<cr> | ||
nnoremap <buffer> <silent> <C-LeftMouse> <LeftMouse>:GOVIMGoToDef<cr> | ||
nnoremap <buffer> <silent> g<LeftMouse> <LeftMouse>:GOVIMGoToDef<cr> | ||
nnoremap <buffer> <silent> <C-t> :GOVIMGoToPrevDef<cr> | ||
nnoremap <buffer> <silent> <C-RightMouse> :GOVIMGoToPrevDef<cr> | ||
nnoremap <buffer> <silent> g<RightMouse> :GOVIMGoToPrevDef<cr> | ||
if GOVIMPluginStatus() == "initcomplete" | ||
setlocal balloonexpr=GOVIM_internal_BalloonExpr() | ||
setlocal omnifunc=GOVIM_internal_Complete | ||
nnoremap <buffer> <silent> gd :GOVIMGoToDef<cr> | ||
nnoremap <buffer> <silent> <C-]> :GOVIMGoToDef<cr> | ||
nnoremap <buffer> <silent> <C-LeftMouse> <LeftMouse>:GOVIMGoToDef<cr> | ||
nnoremap <buffer> <silent> g<LeftMouse> <LeftMouse>:GOVIMGoToDef<cr> | ||
nnoremap <buffer> <silent> <C-t> :GOVIMGoToPrevDef<cr> | ||
nnoremap <buffer> <silent> <C-RightMouse> :GOVIMGoToPrevDef<cr> | ||
nnoremap <buffer> <silent> g<RightMouse> :GOVIMGoToPrevDef<cr> | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package govim | ||
|
||
import "testing" | ||
|
||
func TestParseVersion(t *testing.T) { | ||
input := "\n\nVIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 12 2019 11:38:35)\nPoužité záplaty: 1-1518\npřeložil jnml@e5-1650\nmaximální verzewith GTK2 GUI. Vlastnosti zahrnuté (+) a nezahrnuté (-):\n+acl +clipboard +dnd +gettext +localmap +mouse_urxvt +profile +statusline +timers +windows\n+arabic +cmdline_compl -ebcdic -hangul_input -lua +mouse_xterm -python -sun_workshop +title +writebackup\n+autocmd +cmdline_hist +emacs_tags +iconv +menu +multi_byte -python3 +syntax +toolbar +X11\n+autochdir +cmdline_info +eval +insert_expand +mksession +multi_lang +quickfix +tag_binary +user_commands -xfontset\n-autoservername +comments +ex_extra +job +modify_fname -mzscheme +reltime -tag_old_static +vartabs +xim\n+balloon_eval +conceal +extra_search +jumplist +mouse +netbeans_intg +rightleft -tag_any_white +vertsplit +xpm\n+balloon_eval_term +cryptv -farsi +keymap +mouseshape +num64 -ruby -tcl +virtualedit +xsmp_interact\n+browse +cscope +file_in_path +lambda +mouse_dec +packages +scrollbind +termguicolors +visual +xterm_clipboard\n++builtin_terms +cursorbind +find_in_path +langmap -mouse_gpm +path_extra +signs +terminal +visualextra -xterm_save\n+byte_offset +cursorshape +float +libcall -mouse_jsbterm -perl +smartindent +terminfo +viminfo \n+channel +dialog_con_gui +folding +linebreak +mouse_netterm +persistent_undo -sound +termresponse +vreplace \n+cindent +diff -footer +lispindent +mouse_sgr +postscript +spell +textobjects +wildignore \n+clientserver +digraphs +fork() +listcmds -mouse_sysmouse +printer +startuptime +textprop +wildmenu \n systémový vimrc soubor: \"$VIM/vimrc\"\n uživatelský vimrc soubor: \"$HOME/.vimrc\"\n druhý uživatelský vimrc soubor: \"~/.vim/vimrc\"\n uživatelský exrc soubor: \"$HOME/.exrc\"\n systémový gvimrc soubor: \"$VIM/gvimrc\"\n uživatelský gvimrc soubor: \"$HOME/.gvimrc\"\ndruhý uživatelský gvimrc soubor: \"~/.vim/gvimrc\"\n defaults file: \"$VIMRUNTIME/defaults.vim\"\n systémový soubor s menu: \"$VIMRUNTIME/menu.vim\"\n implicitní hodnota $VIM:\"/home/jnml/share/vim\"\nPřeklad: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/local/include -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 \nLinkuji: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-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 -lelf -ldl " | ||
|
||
got, err := ParseVimVersion([]byte(input)) | ||
if err != nil { | ||
t.Fatalf("unexpected err: %v", err) | ||
} | ||
want := "v8.1.1518" | ||
if got != want { | ||
t.Fatalf("unexpected version: want %v, got %v", want, got) | ||
} | ||
} |