estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...
https://frontmatter.codes
MIT License
1.85k stars 69 forks source link

Issue: Flicker/Blink of Front Matter YAML area #804

Closed bneil closed 2 months ago

bneil commented 2 months ago

Describe the bug When typing, in hugo, the frontmatter yaml area blinks after each keypress

To Reproduce Steps to reproduce the behavior:

  1. Go to a markdown file in front matter, thats prefilled
  2. Start typing
  3. See flicker

Expected behavior Either a setting to turn off if this is expected, or no flicker at all when editing documents

Screenshots

https://github.com/estruyf/vscode-front-matter/assets/198162/c896f0f6-2b26-4b5c-b67d-e58f1d632ac5

Desktop (please complete the following information):

Smartphone (please complete the following information): n/a

Additional context Again, not sure if this is a bug but its wobbles my 👀 . I do not see the front matter yaml area even highlighted when the 'Front Matter' extension is disabled. Which lead me to think it was something with the 'Front Matter' extension. But happy to help track it down. Oh, I also have a vim plugin active in that video, but this also happens without vim. Just after each keypress that area flickers.

This blinking doesn't occur when just navigating the markdown file in hugo.

davidsneighbour commented 2 months ago

A note to add: The blinking is an error message about YAML parse errors in OTHER content files. Frontmatter seems to be scanning content in the background, and the error is thrown into whatever editor window is active. Once all is scanned the error disappears. Then after some time it comes back (rescanning other content files again).

It's happening in the latest Beta version on Ubuntu, too.

estruyf commented 2 months ago

@bneil @davidsneighbour implemented a slight change in the logic, which should have solved the blinking. It had to do with the range calculation and setting the decoration for the front matter zone in the document. Feel free to give it a try in the latest beta version and let me know if the experience is better.

bneil commented 2 months ago

@estruyf When using the beta version, I am no longer seeing the blinking while typing 🎸. However, and this could be unrelated, the files I usually see on the front matter dashboard are missing.

estruyf commented 2 months ago

@bneil, that's great news. The other issue is not related to this one but is probably due to another change in the beta version. #802

In which environment did you test it? Can you verify if it is the same on Windows and macOS?

estruyf commented 2 months ago

@bneil found an issue in the Windows paths, I'm not sure if it is related to the change or an update on VSCode, but when the Windows paths get parsed, the disk letter is returned lowercase, which is why the folder comparison did not work.

I implemented a fix, and it is rolling out. I hope this fixes it on your end as well.

bneil commented 2 months ago

wow, that was it. working like a charm. thanks again!