macvim-dev / macvim-dev/macvim

Syntax highlight getting lost when jumping down large file

Open
#634 13 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

I am writing a book using Asciidoc format. You can find the Asciidoc file here:https://github.com/krlawrence/graph/tree/master/book

I am using MacVim version: 8.0.1420

I have not noticed this problem as much in earlier versions of MacVim and it is not an issue editing the same file on Windows using Gvim.

If I load the file and set the syntax to Asciidoc the highlighting looks fine. However if I then do a search that requires jumping way down the file or if I just manually jump to the end of the file, syntax highlighting is lost. Doing a syntax sync fromstart does not bring it back and setting the syntax back to Asciidoc again only seems to work if I jump back to the top of the file and manually scroll down the file. As soon as I jump down the file again same problem. This seems to have started happening since I updated to this version of MacVim.

My OS is MacOS 10.13.3

I have sometimes seen this behaviour before but never until now encountered a case where doing a syntax sync fromstart does not fix it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the report with the Asciidoc file in the linked book directory, using MacVim 8.0.1420 on macOS. Compare syntax highlighting after loading Asciidoc, jumping to the end, running syntax sync fromstart, and scrolling from the top. Done means highlighting remains correct after large jumps and the reported synchronization command works as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, vim
Domain
desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.