Re: Synchronize syntax highlighting

Christian Brabandt <[email protected]>
Newsgroups gmane.editors.vim
Message-ID <[email protected]>
On Mo, 10 Aug 2026, Janis Papanagnou wrote:

> I've tried various suggestions (minlines, synmaxcol, etc.),
> read the manual for information about possible tweaks
> searched the web, ... - to no avail!
> 
> Trying with various numbers in configs like
> set smc=9000
> syntax sync minlines=1000 maxlines=1000
> 
> I'm still getting no sync in a (even non-demanding) test case:
> opening a 476 line file, max. columns 84 => highlighting okay,
> searching for a text that appears in line 438 => NO SYNC here!
> (After scrolling 3 pages up the sync was okay again.)
> 
> More testing...
> Opened a 80x25 terminal window.
> Same testcase as above. => highlighting okay!!!
> Resized the terminal window to 120x50.
> Opened the file again, same testcase => NO SYNC !
> Resized the terminal window back to 80x25.
> Opened the file again, same testcase => highlighting okay
> 
> This is strange!!!
> Highlighting depends on the terminal size, not on the actual text!

does
:syn sync fromstart

help?

This depends on the current syntax script and file being used, but it is 
worth a try when this happens. I suppose this happens with algol68 
files? This has a hard-coded limit of 500 lines.

It is not generally recommended to use syn sync fromstart in syntax 
script, because it comes with a performance penalty, but in cases when 
you notice syntax being off, it is worth a try.

Best,
Christian
-- 

-- 
-- 
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_use/anoekP02s6s1AliB%40256bit.org.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.