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.71k stars 73 forks source link

E363: Pattern uses more memory than 'maxmempattern' #373

Open rpuntaie opened 1 week ago

rpuntaie commented 1 week ago

Related: https://vi.stackexchange.com/questions/31310/search-throws-e363-pattern-uses-more-memory-than-maxmempattern

quote: "the underlying search, which may be found in separate file like a syntax highlighting definition, should be fixed to have a more efficient pattern."

Issue

When going through a large log file I get a lot of these error messages:

Error detected while processing CursorMoved Autocommands for "*"..function 13[3]..14[68]..matchup#delim#get_current[1]..<SNR>295_get_delim_multi[3]..<SNR>295_get_delim[162]..matchup#delim#skip[8]..matchup#util#in_comment_or_string[1]..matchup#util#in_syntax:
line    5:
E363: Pattern uses more memory than 'maxmempattern'

Info

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Oct 15 2024 14:18:26)
Included patches: 1-785
Compiled by Arch Linux
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +byte_offset       +conceal           -ebcdic            +folding           +jumplist          +lua/dyn           +mouse_netterm     +num64             -python            -sodium            -tag_any_white     +title             +visualextra       +xim               
+arabic            +channel           +cryptv            +emacs_tags        -footer            +keymap            +menu              +mouse_sgr         +packages          +python3/dyn       +sound             +tcl/dyn           +toolbar           +vreplace          -xpm               
+autocmd           +cindent           +cscope            +eval              +fork()            +lambda            +mksession         -mouse_sysmouse    +path_extra        +quickfix          +spell             +termguicolors     +user_commands     +wildignore        +xsmp_interact     
+autochdir         +clientserver      +cursorbind        +ex_extra          +gettext           +langmap           +modify_fname      +mouse_urxvt       +perl/dyn          +reltime           +startuptime       +terminal          +vartabs           +wildmenu          +xterm_clipboard   
-autoservername    +clipboard         +cursorshape       +extra_search      -hangul_input      +libcall           +mouse             +mouse_xterm       +persistent_undo   +rightleft         +statusline        +terminfo          +vertsplit         +windows           -xterm_save        
+balloon_eval      +cmdline_compl     +dialog_con_gui    -farsi             +iconv             +linebreak         +mouseshape        +multi_byte        +popupwin          +ruby/dyn          -sun_workshop      +termresponse      +vim9script        +writebackup       
+balloon_eval_term +cmdline_hist      +diff              +file_in_path      +insert_expand     +lispindent        +mouse_dec         +multi_lang        +postscript        +scrollbind        +syntax            +textobjects       +viminfo           +X11               
+browse            +cmdline_info      +digraphs          +find_in_path      +ipv6              +listcmds          +mouse_gpm         -mzscheme          +printer           +signs             +tag_binary        +textprop          +virtualedit       +xattr             
++builtin_terms    +comments          +dnd               +float             +job               +localmap          -mouse_jsbterm     +netbeans_intg     +profile           +smartindent       -tag_old_static    +timers            +visual            -xfontset          
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "$XDG_CONFIG_HOME/vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
3rd user gvimrc file: "$XDG_CONFIG_HOME/vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/cloudproviders -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/fribidi -I/usr/include/sysprof-6 -pthread -I/usr/include/gio-unix-2.0 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/vim/src=/usr/src/debug/vim -flto=auto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.40/core_perl/CORE -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -L/usr/local/lib -o vim -lgtk-3 -lgdk-3 -lz -lharfbuzz -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo -lcairo-gobject -lgdk_pixbuf-2.0 -lgio-2.0 -lglib-2.0 -lgobject-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lcanberra -lacl -lattr -lgpm -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm 
rpuntaie commented 1 week ago
set maxmempattern=2000000

does help, though.

Please close this if there is no way around setting the number high for this package.

With the default 1000 for maxmempattern the messages appear.

andymass commented 6 days ago

What file type are you editing?

On Wed, Nov 6, 2024 at 8:59 AM Roland Puntaier @.***> wrote:

set maxmempattern=2000000

does help, though.

Please close this if there is no way around setting the number high for this package.

With the default 1000 for maxmempattern the messages appear.

— Reply to this email directly, view it on GitHub https://github.com/andymass/vim-matchup/issues/373#issuecomment-2459827953, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSY3DJNHMVTCJBX5KK7PJTZ7IOCLAVCNFSM6AAAAABRIUZOCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJZHAZDOOJVGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rpuntaie commented 6 days ago

I used the extension .log. :set filetype shows filetype=log.