da-h / AirLatex.vim

Overleaf / ShareLatex in Vim
MIT License
83 stars 8 forks source link

Vim 8 support #1

Open braun-steven opened 4 years ago

braun-steven commented 4 years ago

Hey David, thanks for working on this plugin!

After logging into overleaf and opening a project and running :call Airlatex(), the sidebar pops up and :messages is populated with the following error:

Error detected while processing function AirLatex_project_update:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/tak/.vim/plugged/AirLatex.vim/python/sidebar.py", line 459, in <module> sidebar.triggerRefresh()
  File "/home/tak/.vim/plugged/AirLatex.vim/python/sidebar.py", line 46, in triggerRefresh vim.async_call(refresh)
AttributeError: module 'vim' has no attribute 'async_call'

This error continues to pop up when I want to navigate in the AirLatex sidebar. No connection can be established.

Here is the output of vim --version if it helps you:

VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 29 2019 22:27:49)
Included patches: 1-2102
Compiled by Arch Linux
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_any_white
+arabic            +file_in_path      +mouse_urxvt       +tcl/dyn
+autocmd           +find_in_path      +mouse_xterm       +termguicolors
+autochdir         +float             +multi_byte        +terminal
-autoservername    +folding           +multi_lang        +terminfo
-balloon_eval      -footer            -mzscheme          +termresponse
+balloon_eval_term +fork()            +netbeans_intg     +textobjects
-browse            +gettext           +num64             +textprop
++builtin_terms    -hangul_input      +packages          +timers
+byte_offset       +iconv             +path_extra        +title
+channel           +insert_expand     +perl/dyn          -toolbar
+cindent           +job               +persistent_undo   +user_commands
-clientserver      +jumplist          +postscript        +vartabs
-clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           +python/dyn        +visual
+cmdline_info      +libcall           +python3/dyn       +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          +ruby/dyn          +wildmenu
+cursorbind        +lua/dyn           +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con        +mksession         +smartindent       -X11
+diff              +modify_fname      -sound             -xfontset
+digraphs          +mouse             +spell             -xim
-dnd               -mouseshape        +startuptime       -xpm
-ebcdic            +mouse_dec         +statusline        -xsmp
+emacs_tags        +mouse_gpm         -sun_workshop      -xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary        
+extra_search      +mouse_sgr         -tag_old_static    
   system vimrc file: "/etc/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   -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim        -lm -ltinfo -lelf -lnsl    -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/5.30/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc   -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm

Let me know if I can provide more information.

Additional information:

Edit: Adjusted the airlatex_domain to Overleaf and it now works in NeoVim.

sbrodehl commented 4 years ago

Hi Steven!

Looks like the default domain is indeed a little bit outdated, I issued a PR (#3) to solve that.

da-h commented 4 years ago

Hey @steven-lang,

thanks for this issue & your suggestions!

Unfortunately, vim.async_call is indeed neovim only. However, I am currently working on a synchronized GUI handler that should also work with vim. (I will merge that branch in the next 3-5 days).

Best da-h

PS: I just found a bug related to pushing changes to the server. Now, the plugin is not yet useable in the direction vim -> overleaf-server.

braun-steven commented 4 years ago

Ah good to know. Since 8.0, Vim supports async jobs as well, but the API for that seems to be more complicated, see channels.

da-h commented 4 years ago

Thanks for the reference!

BTW: as of 8a6d06f everything should work right now. ;)