andymass / vim-matchup

vim match-up: even better % :facepunch: navigate and highlight matching words :facepunch: modern matchit and matchparen. Supports both vim and neovim + tree-sitter.
https://www.vim.org/scripts/script.php?script_id=5624
MIT License
1.68k stars 68 forks source link

slew of error messages on opening mail file #175

Open Konfekt opened 3 years ago

Konfekt commented 3 years ago
  1. What vim version are you using? 8.0.1568
  2. Steps to reproduce

Open a mail file in Mutt

  1. Expected behavior

No error messages by matchup

  1. Observed behavior

The following error messages appear:

Errore/i eseguendo function 3[3]..4[68]..matchup#delim#get_current[1]..<SNR>421_get_delim_multi[3]..<SNR>421_get_delim[154]..matchup#perf#timeout_check:
riga    2:
E806: uso di un Numero-a-virgola-mobile come Stringa
Errore/i eseguendo function 3[3]..4[68]..matchup#delim#get_current[1]..<SNR>421_get_delim_multi[3]..<SNR>421_get_delim[154]..matchup#perf#timeout_check:
riga    2:
E15: Espressione non valida: 1000.0 * s:Reltimefloat(reltime(s:timeout_pulse_time))
Errore/i eseguendo function 3[3]..4[68]..matchup#delim#get_current[1]..<SNR>421_get_delim_multi[3]..<SNR>421_get_delim[154]..matchup#perf#timeout_check:
riga    3:
E121: Variabile non definita: l:elapsed
Errore/i eseguendo function 3[3]..4[68]..matchup#delim#get_current[1]..<SNR>421_get_delim_multi[3]..<SNR>421_get_delim[154]..matchup#perf#timeout_check:
riga    3:
E15: Espressione non valida: l:elapsed
Errore/i eseguendo function 3[3]..4[68]..matchup#delim#get_current[1]..<SNR>421_get_delim_multi[3]..<SNR>421_get_delim[154]..matchup#perf#timeout_check:
riga    5:
E806: uso di un Numero-a-virgola-mobile come Stringa
Errore/i eseguendo function 3[3]..4[68]..matchup#delim#get_current[1]..<SNR>421_get_delim_multi[3]..<SNR>421_get_delim[154]..matchup#perf#timeout_check:
riga    5:
E15: Espressione non valida: s:timeout <= 0.0
andymass commented 3 years ago

Hi, it would be helpful to have the outputs of :version and :set.

Konfekt commented 3 years ago

I reproduced it with vim -i NONE -u ~/.vim/viminrc /tmp/test.eml and ~/.viminrc reading

set nocompatible
language messages en_US  " To avoid scrambled non english letters.

" Load plugin
let &rtp = '~/.vim/plugged/vim-matchup/' . ',' . &rtp
filetype plugin indent on
syntax on

" options go here
set hidden

Now :version yields

VIM - Vi IMproved 8.0 (2016 Sep 12)
Patch incluse: 1-1568
Compilato da 'http://www.opensuse.org/'
Versione gigante con GUI GTK3.  Funzionalità incluse (+) o escluse (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    -tcl
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
+balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
+browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          +toolbar
+cindent           +insert_expand     +path_extra        +user_commands
+clientserver      +job               +perl              +vertsplit
+clipboard         +jumplist          +persistent_undo   +virtualedit
+cmdline_compl     +keymap            +postscript        +visual
+cmdline_hist      +lambda            +printer           +visualextra
+cmdline_info      +langmap           +profile           +viminfo
+comments          +libcall           +python/dyn        +vreplace
+conceal           +linebreak         +python3/dyn       +wildignore
+cryptv            +lispindent        +quickfix          +wildmenu
+cscope            +listcmds          +reltime           +windows
+cursorbind        +localmap          +rightleft         +writebackup
+cursorshape       +lua/dyn           +ruby/dyn          +X11
+dialog_con_gui    +menu              +scrollbind        -xfontset
+diff              +mksession         +signs             +xim
+digraphs          +modify_fname      +smartindent       -xpm
+dnd               +mouse             +startuptime       +xsmp_interact
-ebcdic            +mouseshape        +statusline        +xterm_clipboard
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
+eval              +mouse_gpm         +syntax            
+ex_extra          -mouse_jsbterm     +tag_binary        
+extra_search      +mouse_netterm     +tag_old_static    
   file vimrc di sistema: "/etc/vimrc"
       file vimrc utente: "$HOME/.vimrc"
    II file vimrc utente: "~/.vim/vimrc"
        file exrc utente: "$HOME/.exrc"
  file gvimrc di sistema: "/etc/gvimrc"
      file gvimrc utente: "$HOME/.gvimrc"
   II file gvimrc utente: "~/.vim/gvimrc"
        file dei default: "$VIMRUNTIME/defaults.vim"
    file menu di sistema: "$VIMRUNTIME/menu.vim"
         $VIM di riserva: "/usr/share/vim"
Compilazione: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/libxkbcommon -I/usr/include/wayland -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -Wall -pipe -fno-strict-aliasing -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Link: gcc   -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26.1/x86_64-linux-thread-multi/CORE   -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lSM -lICE  -lm    -ltinfo -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26.1/x86_64-linux-thread-multi/CORE  -L/usr/local/lib64 -fstack-protector-strong  -L/usr/lib/perl5/5.26.1/x86_64-linux-thread-multi/CORE -lperl -lm -ldl -lcrypt -lpthread        

and

:set gives

--- Opzioni ---
  autoindent          hidden              pyxversion=3        tabpagemax=50
  autoread            history=1000        ruler               textwidth=68
  display=lastline    incsearch           scroll=16           ttimeout
  expandtab           laststatus=2        scrolloff=1         ttimeoutlen=100
  filetype=mail       linebreak           shiftwidth=2        ttyfast
  foldlevel=1         makeprg=proselint   sidescrolloff=5     ttymouse=xterm2
  foldmethod=expr   nomodeline            smarttab            viminfofile=NONE
  foldminlines=2      modified            spell               wildmenu
  helplang=en         nrformats=bin,hex   syntax=mail
  backspace=indent,eol,start
  comments=s1:/*,ex:*/,://,b:#,:%,:XCOMM,n:>
  commentstring=> %s
  complete=.,w,b,u,t
  errorformat=%f:%l:%c: %m
  fileencoding=utf-8
  fileencodings=utf-8,iso8859-1
  foldexpr=strlen(substitute(matchstr(getline(v:lnum),'\v^\s*%(\>\s*)+'),'\s','','
g'))
  formatoptions=jtcqlnw
  formatlistpat=\C^\s*[\[({]\?\([0-9]\+\|[iIvVxXlLcCdDmM]\+\|[a-zA-Z]\)[\]:.)}]\s\
+\|^\s*[-+*o–•]\s\+
  keywordprg=:Silent! goldendict
  listchars=tab:> ,trail:-,extends:>,precedes:<,nbsp:+
  matchpairs=(:),{:},[:],<:>
  runtimepath=~/.vim/plugged/vim-matchup/,~/.vim,/usr/share/vim/site,/usr/share/vi
m/vim80,/usr/share/vim/site/after,~/.vim/after
  sessionoptions=blank,buffers,curdir,folds,help,tabpages,winsize
  tags=./tags;,./TAGS,tags,TAGS
  viewoptions=folds,cursor,curdir
  viminfo=!,'100,<50,s10,h
Konfekt commented 3 years ago

This issue could perhaps be related to , acting as a decimal separator by the Italian language locale.

andymass commented 3 years ago

This issue could perhaps be related to , acting as a decimal separator by the Italian language locale.

I agree it appears to be exactly this, however, I cannot reproduce this even using 8.0.1568, your example, and setting locale to it_IT.UTF-8.

I believe vim still uses dot for floats regardless of locale. What's :lang say? What does echo 12.34 say?

I know there is at least one relevant patch https://github.com/vim/vim/issues/7003. I am curious if newer vesions of vim behave the same way.

Konfekt commented 3 years ago

Thanks for the pointer. Indeed the issue disappears once LC_NUMERIC=C (instead of it_IT.UTF-8) set.

Konfekt commented 3 years ago

The issue is there as long as there are digits separated by. or , in the text.

Konfekt commented 3 years ago

That is, test.eml could read


> 1,1

to reproduce the error with LC_NUMERIC=it_IT.UTF-8.

andymass commented 3 years ago

Sorry I'm a little bit confused here- are you saying the contents of the file matters, that if the eml file does not contain 1,1 then it works fine? For that matter, does this only happen with eml files?

Anyway, how are you setting LC_NUMERIC=it_IT.UTF-8?

Konfekt commented 3 years ago

The issue disappears once LC_NUMERIC=C (instead of it_IT.UTF-8) set.

Setting LC_NUMERIC=it_IT.UTF-8, the issue appears as soon as there are digits separated by . or , in quoted parts of the eml file. For example

> 1,1

I did not check thoroughly for other file types. It does not happen by adding a . or , to markdown or text files, at least.

Konfekt commented 3 years ago

Anyway, how are you setting LC_NUMERIC=it_IT.UTF-8?

It is set system-wide on Opensuse 15.3, not by the user.