xuhdev / vim-latex-live-preview

A Vim Plugin for Lively Previewing LaTeX PDF Output
https://www.topbug.net/blog/2013/06/13/live-preview-of-latex-in-vim/
GNU General Public License v3.0
833 stars 73 forks source link

Error messages not showing correctly #43

Open D0048 opened 7 years ago

D0048 commented 7 years ago

Expected behavior

The error messages like these:

    if v:shell_error != 0
        echo 'Failed to compile'
        lcd -
        return

could show normally.

Actual behavior

These messages just blink and disappear.

Steps to reproduce

  1. Use any document that may trigger an error. (like the "Failed to compile" one above)
  2. Start preview.
  3. Nothing happened and the error message blinks and disappear within milliseconds.

System configuration

# output of `vim --version`
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +tag_binary
+arabic          +file_in_path    +mouse_sgr       +tag_old_static
+autocmd         +find_in_path    -mouse_sysmouse  -tag_any_white
+balloon_eval    +float           +mouse_urxvt     +tcl
+browse          +folding         +mouse_xterm     +terminfo
++builtin_terms  -footer          +multi_byte      +termresponse
+byte_offset     +fork()          +multi_lang      +textobjects
+channel         +gettext         -mzscheme        +timers
+cindent         -hangul_input    +netbeans_intg   +title
+clientserver    +iconv           +packages        +toolbar
+clipboard       +insert_expand   +path_extra      +user_commands
+cmdline_compl   +job             +perl            +vertsplit
+cmdline_hist    +jumplist        +persistent_undo +virtualedit
+cmdline_info    +keymap          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       -python          +vreplace
+cscope          +lispindent      +python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con_gui  +lua             +rightleft       +writebackup
+diff            +menu            +ruby            +X11
+digraphs        +mksession       +scrollbind      -xfontset
+dnd             +modify_fname    +signs           +xim
-ebcdic          +mouse           +smartindent     +xsmp_interact
+emacs_tags      +mouseshape      +startuptime     +xterm_clipboard
+eval            +mouse_dec       +statusline      -xterm_save
+ex_extra        +mouse_gpm       -sun_workshop    +xpm
+extra_search    -mouse_jsbterm   +syntax          
   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"
    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/include/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/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -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 -D_REENTRANT -DORBIT2=1 -pthread -I/usr/include/libgnomeui-2.0 -I/usr/include/gnome-keyring-1 -I/usr/include/libbonoboui-2.0 -I/usr/include/libxml2 -I/usr/include/libgnome-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/orbit-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -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/include/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/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/x86_64-linux-gnu/gnome-vfs-2.0/include -I/usr/include/gconf/2 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time  -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E  -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -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  -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lgnomecanvas-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lfreetype -lgdk_pixbuf-2.0 -lgnomevfs-2 -lgconf-2 -lgthread-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -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.22/CORE -lperl -ldl -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 -lm -lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm     
D0048 commented 7 years ago

Add: After adding the following code at the beginning of the s:StartPreview(...) function, like this:

...
function! s:StartPreview(...)
    echo 'dummy'
    lcd -
    "The above 2 lines must exist for any error message to show.
    let b:livepreview_buf_data = {}
    ...

The error message will appear. Don't know why thou.

badouralix commented 7 years ago

Hi @D0048! Thanks for reporting!

I haven't successfully reproduced your bug on Huge version without GUI... Maybe it is related to your Huge version with GTK2-GNOME GUI (but then I wouldn't know why...) What kind of other plugins are you using? :scriptnames to figure it out

D0048 commented 7 years ago

The complete output of :scriptnames is at below. Btw, I think the vim-airline plugin is the most suspicious.

  1: /usr/share/vim/vimrc
  2: /usr/share/vim/vim74/debian.vim
  3: /usr/share/vim/vim74/syntax/syntax.vim
  4: /usr/share/vim/vim74/syntax/synload.vim
  5: /usr/share/vim/vim74/syntax/syncolor.vim
  6: /usr/share/vim/vim74/filetype.vim
  7: ~/.vimrc
  8: /usr/share/vim/vim74/syntax/nosyntax.vim
  9: ~/.vim/bundle/vundle/autoload/vundle.vim
 10: ~/.vim/bundle/vundle/autoload/vundle/config.vim
 11: /usr/share/vim/vim74/ftplugin.vim
 12: /usr/share/vim/vim74/indent.vim
 13: /usr/share/vim/vim74/delmenu.vim
 14: /usr/share/vim/vim74/menu.vim
 15: /usr/share/vim/vim74/lang/menu_zh_cn.utf-8.vim
 16: /usr/share/vim/vim74/autoload/paste.vim
 17: ~/.vim/plugin/NERD_Commenter.vim
 18: ~/.vim/plugin/SyntaxFolds.vim
 19: ~/.vim/plugin/filebrowser.vim
 20: ~/.vim/plugin/imaps.vim
 21: ~/.vim/plugin/latexlivepreview.vim
 22: ~/.vim/plugin/remoteOpen.vim
 23: ~/.vim/bundle/YouCompleteMe/plugin/youcompleteme.vim
 24: ~/.vim/bundle/vim-latex-live-preview/plugin/latexlivepreview.vim
 25: ~/.vim/bundle/tagbar/plugin/tagbar.vim
 26: ~/.vim/bundle/vim-autoformat/plugin/autoformat.vim
 27: ~/.vim/bundle/vim-autoformat/plugin/defaults.vim
 28: ~/.vim/bundle/vim-autoformat/plugin/utils.vim
 29: ~/.vim/bundle/vim-airline/plugin/airline.vim
 30: ~/.vim/bundle/vim-airline/autoload/airline.vim
 31: ~/.vim/bundle/vim-airline/autoload/airline/init.vim
 32: ~/.vim/bundle/vim-airline/autoload/airline/parts.vim
 33: ~/.vim/bundle/vim-airline-themes/plugin/airline-themes.vim
 34: ~/.vim/bundle/syntastic/plugin/syntastic/autoloclist.vim
 35: ~/.vim/bundle/syntastic/plugin/syntastic/balloons.vim
 36: ~/.vim/bundle/syntastic/plugin/syntastic/checker.vim
 37: ~/.vim/bundle/syntastic/plugin/syntastic/cursor.vim
 38: ~/.vim/bundle/syntastic/plugin/syntastic/highlighting.vim
 39: ~/.vim/bundle/syntastic/plugin/syntastic/loclist.vim
 40: ~/.vim/bundle/syntastic/plugin/syntastic/modemap.vim
 41: ~/.vim/bundle/syntastic/plugin/syntastic/notifiers.vim
 42: ~/.vim/bundle/syntastic/plugin/syntastic/registry.vim
 43: ~/.vim/bundle/syntastic/plugin/syntastic/signs.vim
 44: ~/.vim/bundle/syntastic/plugin/syntastic.vim
 45: ~/.vim/bundle/syntastic/autoload/syntastic/util.vim
 46: ~/.vim/bundle/nerdcommenter/plugin/NERD_commenter.vim
 47: ~/.vim/bundle/vimshell.vim/plugin/vimshell.vim
 48: ~/.vim/bundle/vimproc.vim/plugin/vimproc.vim
 49: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
 50: /usr/share/vim/vim74/plugin/gzip.vim
 51: /usr/share/vim/vim74/plugin/logiPat.vim
 52: /usr/share/vim/vim74/plugin/matchparen.vim
 53: /usr/share/vim/vim74/plugin/netrwPlugin.vim
 54: /usr/share/vim/vim74/plugin/rrhelper.vim
55: /usr/share/vim/vim74/plugin/spellfile.vim
 56: /usr/share/vim/vim74/plugin/tarPlugin.vim
 57: /usr/share/vim/vim74/plugin/tohtml.vim
 58: /usr/share/vim/vim74/plugin/vimballPlugin.vim
 59: /usr/share/vim/vim74/plugin/zipPlugin.vim
 60: ~/.vim/bundle/vim-airline/autoload/airline/extensions.vim
 61: ~/.vim/bundle/vim-airline/autoload/airline/extensions/quickfix.vim
 62: ~/.vim/bundle/vim-airline/autoload/airline/extensions/netrw.vim
 63: ~/.vim/bundle/vim-airline/autoload/airline/extensions/tagbar.vim
 64: ~/.vim/bundle/vim-airline/autoload/airline/extensions/syntastic.vim
 65: ~/.vim/bundle/vim-airline/autoload/airline/extensions/whitespace.vim
 66: ~/.vim/bundle/vim-airline/autoload/airline/extensions/po.vim
 67: ~/.vim/bundle/vim-airline/autoload/airline/extensions/wordcount.vim
 68: ~/.vim/bundle/vim-airline/autoload/airline/extensions/tabline.vim
 69: ~/.vim/bundle/vim-airline/autoload/airline/extensions/tabline/autoshow.vim
 70: ~/.vim/bundle/vim-airline/autoload/airline/extensions/tabline/tabs.vim
 71: ~/.vim/bundle/vim-airline/autoload/airline/extensions/tabline/buffers.vim
 72: ~/.vim/bundle/vim-airline/autoload/airline/extensions/tabline/ctrlspace.vim
 73: ~/.vim/bundle/vim-airline/autoload/airline/extensions/keymap.vim
 74: ~/.vim/bundle/vim-airline/autoload/airline/section.vim
 75: ~/.vim/bundle/vim-airline/autoload/airline/highlighter.vim
 76: ~/.vim/bundle/vim-airline-themes/autoload/airline/themes/bubblegum.vim
 77: ~/.vim/bundle/vim-airline/autoload/airline/themes.vim
 78: ~/.vim/bundle/vim-airline/autoload/airline/util.vim
 79: ~/.vim/bundle/vim-airline/autoload/airline/builder.vim
 80: ~/.vim/bundle/vim-airline/autoload/airline/extensions/default.vim
 81: ~/.vim/bundle/syntastic/autoload/syntastic/log.vim
 82: ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
 83: ~/.vim/bundle/vim-airline/autoload/airline/extensions/tabline/buflist.vim
 84: ~/.vim/bundle/vim-airline/autoload/airline/extensions/tabline/formatters/default.vim
 85: ~/.vim/bundle/tagbar/autoload/tagbar.vim
 86: ~/.vim/bundle/tagbar/autoload/tagbar/debug.vim
 87: ~/.vim/bundle/tagbar/autoload/tagbar/types/ctags.vim
 88: ~/.vim/bundle/tagbar/autoload/tagbar/prototypes/typeinfo.vim
badouralix commented 7 years ago

Did you figure out what was happening? By disabling other plugins for instance

D0048 commented 7 years ago

It's not the air-line plugin. But this is probably a conflict with some other plugins since it works after I disabled all of them. Consider I don't yet have time to try to exclude each script one by one, For any of whom encountered similar issues, try adding an output like this to the beginning of the StartPreview function like this:

...
function! s:StartPreview(...)
    echo 'Starting'
    lcd -
    "The above 2 lines must exist for any error message to show.
    ...