[vim/vim] Python syntax highlighting exceeds maxmempattern for strings (Issue #19079)

2 views
Skip to first unread message

Adam J. Stewart

unread,
Jan 4, 2026, 9:59:20 AM (2 days ago) Jan 4
to vim/vim, Subscribed
adamjstewart created an issue (vim/vim#19079)

Steps to reproduce

The latest version of vim that ships with macOS Tahoe seems to have issues with syntax highlighting for potentially long strings in Python. To reproduce:

  1. Download a file like https://github.com/torchgeo/torchgeo/blob/main/tests/data/prisma/data.py
  2. Open file: vim data.py
  3. Enable syntax highlight: syntax on
  4. Create a new line at the top of the file: Shift+o
  5. Start typing a string: x = ' (must be single quote, double quote has no issue)

This results in the following error msg:

E363: Pattern uses more memory than 'maxmempattern'

Vim is unable to recover from this even after the string is closed. I must reopen the file or rerun syntax on.

I have no ~/.vimrc or ~/.vim to influence reproducibility.

Expected behaviour

I would expect vim to have some kind of fallback behavior when it can't find the end of a string, and gracefully recover once the string is complete.

Version of Vim

9.1

Environment

OS: macOS Tahoe 26.1
Terminal: Terminal 2.15 (465)
$TERM: xterm-256color
Shell: fish 4.0.0

Logs and stack traces

log.txt


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19079@github.com>

Christian Brabandt

unread,
Jan 4, 2026, 10:03:41 AM (2 days ago) Jan 4
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19079)

Cannot reproduce, please always try to reproduce using vim --clean. I also wonder what this means: "vim that ships with macOS Tahoe" and you did not share the whole :version output.

So please try latest version of master branch using vim --clean. And if this is fixed, complain to Apple about this.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19079/3708160741@github.com>

Adam J. Stewart

unread,
Jan 4, 2026, 1:26:23 PM (2 days ago) Jan 4
to vim/vim, Subscribed
adamjstewart left a comment (vim/vim#19079)

Apologies for the missing information, perhaps these suggestions could be added to the GitHub issue template?

I am able to reproduce this issue with vim --clean.

Full :version output:

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Oct 11 2025 01:19:19)
macOS version - arm64
Included patches: 1-1752
Compiled by ro...@apple.com
Normal version without GUI.  Features included (+) or not (-):
+acl               +cmdline_hist      +ex_extra          +jumplist          +mouse_dec         -perl              -socketserver      +terminfo          +vreplace
-arabic            +cmdline_info      +extra_search      -keymap            -mouse_gpm         +persistent_undo   -sodium            +termresponse      -wayland
+autocmd           +comments          -farsi             +lambda            -mouse_jsbterm     +popupwin          -sound             +textobjects       -wayland_clipboard
+autochdir         +conceal           +file_in_path      -langmap           +mouse_netterm     +postscript        +spell             +textprop          +wildignore
-autoservername    +cryptv            +find_in_path      +libcall           +mouse_sgr         +printer           +startuptime       +timers            +wildmenu
-balloon_eval      +cscope            +float             +linebreak         -mouse_sysmouse    -profile           +statusline        +title             +windows
-balloon_eval_term +cursorbind        +folding           +lispindent        +mouse_urxvt       -python            -sun_workshop      -toolbar           +writebackup
-browse            +cursorshape       -footer            +listcmds          +mouse_xterm       -python3           +syntax            +user_commands     -X11
++builtin_terms    +dialog_con        +fork()            +localmap          +multi_byte        +quickfix          -tabpanel          -vartabs           -xattr
+byte_offset       +diff              -gettext           -lua               +multi_lang        +reltime           +tag_binary        +vertsplit         -xfontset
+channel           +digraphs          -hangul_input      +menu              -mzscheme          -rightleft         -tag_old_static    +vim9script        -xim
+cindent           -dnd               +iconv             +mksession         +netbeans_intg     -ruby              -tag_any_white     +viminfo           -xpm
-clientserver      -ebcdic            +insert_expand     +modify_fname      +num64             +scrollbind        -tcl               +virtualedit       -xsmp
+clipboard         -emacs_tags        +ipv6              +mouse             +packages          +signs             +termguicolors     +visual            -xterm_clipboard
+cmdline_compl     +eval              +job               -mouseshape        +path_extra        +smartindent       +terminal          +visualextra       -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "~/.config/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   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework Cocoa

I am not able to reproduce the issue with vim's master branch:

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan  4 2026 19:23:02)
macOS version - arm64
Included patches: 1-2050
Compiled by Adam@Vesuvius
Normal version without GUI.  Features included (+) or not (-):
+acl                 +comments            +float               +localmap            +netbeans_intg       +smartindent         +textobjects         +wildmenu
-arabic              +conceal             +folding             -lua                 +num64               +socketserver        +textprop            +windows
+autocmd             +cryptv              -footer              +menu                +packages            -sodium              +timers              +writebackup
+autochdir           -cscope              +fork()              +mksession           +path_extra          -sound               +title               -X11
-autoservername      +cursorbind          -gettext             +modify_fname        -perl                +spell               -toolbar             -xattr
-balloon_eval        +cursorshape         -hangul_input        +mouse               +persistent_undo     +startuptime         +user_commands       -xfontset
-balloon_eval_term   +dialog_con          +iconv               -mouseshape          +popupwin            +statusline          -vartabs             -xim
-browse              +diff                +insert_expand       +mouse_dec           +postscript          -sun_workshop        +vertsplit           -xpm
++builtin_terms      +digraphs            +ipv6                -mouse_gpm           +printer             +syntax              +vim9script          -xsmp
+byte_offset         -dnd                 +job                 -mouse_jsbterm       -profile             -tabpanel            +viminfo             -xterm_clipboard
+channel             -ebcdic              +jumplist            +mouse_netterm       -python              +tag_binary          +virtualedit         -xterm_save
+cindent             -emacs_tags          -keymap              +mouse_sgr           -python3             -tag_old_static      +visual
+clientserver        +eval                +lambda              -mouse_sysmouse      +quickfix            -tag_any_white       +visualextra
+clipboard           +ex_extra            -langmap             +mouse_urxvt         +reltime             -tcl                 +vreplace
+clipboard_provider  +extra_search        +libcall             +mouse_xterm         -rightleft           +termguicolors       -wayland
+cmdline_compl       -farsi               +linebreak           +multi_byte          -ruby                -terminal            -wayland_clipboard
+cmdline_hist        +file_in_path        +lispindent          +multi_lang          +scrollbind          +terminfo            -wayland_focus_steal
+cmdline_info        +find_in_path        +listcmds            -mzscheme            +signs               +termresponse        +wildignore
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "~/.config/vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/Users/Adam/spack/opt/spack/darwin-m2/vim-master-b2gfcadm6qjg64jbozmmlouinu7yfikh/share/vim"
Compilation: /Users/Adam/spack/opt/spack/darwin-m2/compiler-wrapper-1.0-e6qqck2oywzs7oyslnaqpflwk72b2fwd/libexec/spack/clang/clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARW
IN -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: /Users/Adam/spack/opt/spack/darwin-m2/compiler-wrapper-1.0-e6qqck2oywzs7oyslnaqpflwk72b2fwd/libexec/spack/clang/clang -o vim -lm -ltinfow -liconv -framework AppKit

I will try to open a bug report with Apple and use my source build for now.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19079/3708313152@github.com>

Adam J. Stewart

unread,
Jan 4, 2026, 1:26:26 PM (2 days ago) Jan 4
to vim/vim, Subscribed

Closed #19079 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/19079/issue_event/21842657090@github.com>

Reply all
Reply to author
Forward
0 new messages