]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0689: the "%" command is slow on a long line with many slashes v9.2.0689
authorHirohito Higashi <h.east.727@gmail.com>
Sun, 21 Jun 2026 14:53:03 +0000 (14:53 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 21 Jun 2026 14:53:03 +0000 (14:53 +0000)
commit9f9af034adcdb5773e19c4bb52e3c368bbce826e
treed4795028a8ba333d45ff0232e7724c12b0f33482
parent77099ed6b3b35b6340fd4945ba219020034a9182
patch 9.2.0689: the "%" command is slow on a long line with many slashes

Problem:  The "%" command can be very slow on a long line that contains
          many slashes, for example a line of base64 data.
Solution: When looking for a line comment, scan the line only once while
          skipping over strings, instead of rescanning from the start for
          every slash.  Move check_linecomment() to cindent.c so it can
          reuse the file-local skip_string().

related: #20491
fixes:   #20557
closes:  #20575

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/cindent.c
src/proto/cindent.pro
src/proto/search.pro
src/search.c
src/testdir/test_normal.vim
src/version.c