[vim/vim] vim not detecting long comments in HTML (Issue #13885)

23 views
Skip to first unread message

Srajan Dehariya

unread,
Jan 18, 2024, 3:57:02 PM1/18/24
to vim/vim, Subscribed

Steps to reproduce

  1. Open an HTML file with ~2000 lines of code (may include css or js)
  2. Do a multiline comment on a large part of code by enclosing it with <!-- and --> (about 700 lines)
  3. Save and close the file. ( The cursor is where the comment ends)
  4. Again open the same file, it will not detect a major part of comment as comment and show as usual HTML, CSS or Js code.

Expected behaviour

It was expected to detect the closing of comment and color the commented code as comments.

Version of Vim

9.0.1499

Environment

Operating system: Debian 12
Terminal: Konsole
Value of $TERM: xterm-256color
Shell: Bash

Logs and stack traces

No response


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/13885@github.com>

Christian Robinson

unread,
Jan 18, 2024, 4:10:16 PM1/18/24
to vim...@googlegroups.com, vim/vim, Subscribed
This is intentional, to keep Vim from slowing down too much with huge syntax regions. If you want to override this behavior try:

    :syn sync fromstart 

In the HTML file. 


-- 
Christian J. Robinson

On Jan 18, 2024, at 1:57 PM, Srajan Dehariya <vim-dev...@256bit.org> wrote:


--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/13885%40github.com.

Christian Brabandt

unread,
Jan 19, 2024, 2:27:32 AM1/19/24
to vim/vim, Subscribed

You are not very specific, there are two things that may come into play:

  • the column where the cursor is is too far away from the beginning of the line. This is handled by the 'synmaxcol' option and in general is a good idea to limit to avoid slowness
  • the syntax file may get out of sync. You can force to resync by using :syn sync fromstart.

Please read the help at :h syn-sync and :h 'synmaxcol'.


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/13885/1899897916@github.com>

Srajan Dehariya

unread,
Jan 20, 2024, 3:52:12 AM1/20/24
to vim/vim, Subscribed

Closed #13885 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/13885/issue_event/11545290485@github.com>

Reply all
Reply to author
Forward
0 new messages