macvim icon indicating copy to clipboard operation
macvim copied to clipboard

Big Sur -- Syntax problems: texNewMathZone undefined.

Open zhuosongz opened this issue 4 years ago • 7 comments

Describe the bug After I upgrade brew packages, I found that it always get a error message when I open a tex file:

E117: Unknown function: TexNewMathZone.

To Reproduce Detailed steps to reproduce the behavior:

  1. In ~/.vim/after/syntax/tex.vim, add one line: call TexNewMathZone("E","align",1)
  2. Open a tex file
  3. It shows: E117: Unknown function: TexNewMathZone.

Environment (please complete the following information):

  • Vim version [e.g. 8.2] (Or paste the result of vim --version.)
  • OS: Mac Big Sur
  • Terminal: Terminal

zhuosongz avatar Dec 05 '20 12:12 zhuosongz

For step 1, do you mean you are manually adding that line that calls the TexNewMathZone function? Where is it supposed to be? I guess I'm not understanding why you would add call a function if it doesn't exist.

For your Vim version, can you include more details by actually pasting in the result of vim --version? Also, how are you installing Vim?

ychin avatar Dec 06 '20 09:12 ychin

Thank you very much for your reply.

Yes, I manually add the line in my user syntax file: ~/.vim/after/syntax/tex.vim.

This call of function worked normally before this update. The function TexNewMathZone exists in the vimfile: MacVim.app/Contents/Resources/vim/runtime/syntax/tex.vim.

I install MacVim by brew install macvim.

version VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 3 2020 01:24:40) macOS version Patch: 1-1719 Compiler: Homebrew

+acl +file_in_path -mouse_sysmouse -tag_old_static +arabic +find_in_path +mouse_urxvt -tag_any_white +autocmd +float +mouse_xterm +tcl +autochdir +folding +multi_byte +termguicolors -autoservername -footer +multi_lang +terminal +balloon_eval +fork() -mzscheme +terminfo +balloon_eval_term +fullscreen +netbeans_intg +termresponse +browse +gettext +num64 +textobjects ++builtin_terms -hangul_input +odbeditor +textprop +byte_offset +iconv +packages +timers +channel +insert_expand +path_extra +title +cindent +ipv6 +perl +toolbar +clientserver +job +persistent_undo +transparency +clipboard +jumplist +popupwin +user_commands +cmdline_compl +keymap +postscript +vartabs +cmdline_hist +lambda +printer +vertsplit +cmdline_info +langmap +profile +virtualedit +comments +libcall -python +visual +conceal +linebreak +python3 +visualextra +cryptv +lispindent +quickfix +viminfo +cscope +listcmds +reltime +vreplace +cursorbind +localmap +rightleft +wildignore +cursorshape +lua +ruby +wildmenu +dialog_con_gui +menu +scrollbind +windows +diff +mksession +signs +writebackup +digraphs +modify_fname +smartindent -X11 +dnd +mouse -sound -xfontset -ebcdic +mouseshape +spell +xim +emacs_tags +mouse_dec +startuptime -xpm +eval -mouse_gpm +statusline -xsmp +ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard +extra_search +mouse_netterm +syntax -xterm_save -farsi +mouse_sgr +tag_binary System vimrc: "$VIM/vimrc" User vimrc: "$HOME/.vimrc" Second user vimrc: "~/.vim/vimrc" User exrc : "$HOME/.exrc" System gvimrc : "$VIM/gvimrc" User gvimrc: "$HOME/.gvimrc" Second User gvimrc: "~/.vim/gvimrc" defaults file: "$VIMRUNTIME/defaults.vim" System menu: "$VIMRUNTIME/menu.vim" $VIM default: "/Applications/MacVim.app/Contents/Resources/vim" Compile: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unk nown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FOR TIFY_SOURCE=1

zhuosongz avatar Dec 06 '20 09:12 zhuosongz

I'm not quite able to reproduce this. So if you manually call that function, does it work? And you are sure set ft? shows tex right? Are you installing MacVim via multiple ways? And how are you launching MacVim anyway?

ychin avatar Dec 11 '20 09:12 ychin

Pinging @zhuosongz. I couldn't quite reproduce this, Big Sur or not. Can you try to manually call the function etc per the above comment? Also, there should have been a new version out, so feel free to try that first. Otherwise I will close the ticket.

ychin avatar Dec 27 '20 00:12 ychin

I have the same problem as @zhuosongz . Every time I load a .tex file the editor throw the error "Unknown function: TexNewMathZone" even though the function is actually defined in $VIMRUNTIME/syntax/tex.vim.

I am using neovim NVIM v0.6.1 Build type: Release LuaJIT 2.1.0-beta3 Features: +acl +iconv +tui

torralbofco avatar Mar 16 '22 18:03 torralbofco

Please check :set rtp and :scriptnames when the error occurs.

ichizok avatar Mar 17 '22 03:03 ichizok

Thanks for your response.

I think I have solved the problem. I believe it is an incompatibility between the standard syntax files for TeX and the ones that the plugin vimtex install. I've just removed the file that causes the error (in my case .config/nvim/after/syntax/tex/amsmath.vim) and everything looks fine. I have check TeX syntax in several files I cannot detect any changes so I believe vimtex also have syntax files for the LaTeX amsmath package.

torralbofco avatar Mar 17 '22 10:03 torralbofco