Magic carriage returns or pastings #745

Closed
opened 2026-10-05 03:03:19 +02:00 by adam · 16 comments
Owner

Describe the bug
Sometimes a set of carriage returns, seems 3 at once, is added to my multiline "info" field, for every line, every 2 seconds.

To Reproduce
Steps to reproduce the behavior:

I have some files with following TOML metadata but have the issue with YAML metadata too.
The "info" field has multiline content with special characters.
I don't know exactly how this bug starts but it seems related to copy-paste and switching from FrontMatter view to File view, after performing file search.
I also notice excessive magic pastings of my info field frontmatter below to some other open files that don't have info field or have another simple info field, when I switch focus (FM view more often than File view).

I only have this bug with such complex multiline content.

The include syntax below is a way of including a markdown file into another for the Hugo theme I use, but I also keep this into info field for backup reason.

info = """
Some text.

View full list :

{{% include "../../includes/my_listing" hidefirstheading %}}"""

Expected behavior
No magic pasting or such reformatting.

Screenshots
Not recorded yet.

Device:

  • OS: Windows 11
  • Front Matter CMS Version 10.8.0
  • Browser: not applicable

Additional context
Restarting VS Code temporarily solves the magic behavior. Sometimes closing all files so that FM has no active file is enough.

**Describe the bug** Sometimes a set of carriage returns, seems 3 at once, is added to my multiline "info" field, for every line, every 2 seconds. **To Reproduce** Steps to reproduce the behavior: I have some files with following TOML metadata but have the issue with YAML metadata too. The "info" field has multiline content with special characters. I don't know exactly how this bug starts but it seems related to copy-paste and switching from FrontMatter view to File view, after performing file search. I also notice excessive magic pastings of my info field frontmatter below to some other open files that don't have info field or have another simple info field, when I switch focus (FM view more often than File view). I only have this bug with such complex multiline content. The include syntax below is a way of including a markdown file into another for the Hugo theme I use, but I also keep this into info field for backup reason. ``` info = """ Some text. View full list : {{% include "../../includes/my_listing" hidefirstheading %}}""" ``` **Expected behavior** No magic pasting or such reformatting. **Screenshots** Not recorded yet. **Device:** - OS: Windows 11 - Front Matter CMS Version 10.8.0 - Browser: not applicable **Additional context** Restarting VS Code temporarily solves the magic behavior. Sometimes closing all files so that FM has no active file is enough. <!-- github-sync-id:3169367614 -->
adam closed this issue 2026-10-05 03:03:19 +02:00
Author
Owner

@postb99 do you have by any chance GitHub Copilot enabled?

@postb99 do you have by any chance GitHub Copilot enabled? <!-- github-comment-id:3022263191 -->
Author
Owner

Yes I have. Can I disable it only for frontmatter extension ? Or else for my workspace. Thanks for the point, I'll give a try.

Yes I have. Can I disable it only for frontmatter extension ? Or else for my workspace. Thanks for the point, I'll give a try. <!-- github-comment-id:3022276928 -->
Author
Owner

Yes, you should be able to go to your extensions panel, find GitHub Copilot, and there you have a disable button. You should be able to set it to disable for workspace.

Image

Let me know if this fixes the magic, if not, I have to try to reproduce it somehow.

Yes, you should be able to go to your extensions panel, find GitHub Copilot, and there you have a disable button. You should be able to set it to disable for workspace. ![Image](https://github.com/user-attachments/assets/bb8cafac-68f3-450e-8973-fbdb2521570c) Let me know if this fixes the magic, if not, I have to try to reproduce it somehow. <!-- github-comment-id:3022350291 -->
Author
Owner

After disabling Github Copilot in workspace, I still see the strange behavior.

Here is how looks undesirable change added to an open file...

Image

To reproduce it:

  • have several files open
  • in one, paste multiline text in info text field
  • observe somehow magically changed files. At a moment, every open files becomes a pasting target... but no carriage returns added, just magic pastes.
After disabling Github Copilot in workspace, I still see the strange behavior. Here is how looks undesirable change added to an open file... <img width="893" height="623" alt="Image" src="https://github.com/user-attachments/assets/4484b0a4-31e4-4267-94fe-863391f8c7c9" /> To reproduce it: - have several files open - in one, paste multiline text in info text field - observe somehow magically changed files. At a moment, every open files becomes a pasting target... but no carriage returns added, just magic pastes. <!-- github-comment-id:3063746053 -->
Author
Owner

Thanks for the details. Would you be able to create a recording, so that I can do the same steps? Thanks 🙏

Thanks for the details. Would you be able to create a recording, so that I can do the same steps? Thanks 🙏 <!-- github-comment-id:3063814045 -->
Author
Owner

Great, I could reproduce it with rather simple steps. I attach a recording at time I noticed the magic pasting happening.

Since you forked my site to fix front matter settings, I think you can continue playing with it. However I should add a note to README to clone the Hugo theme else Front Matter is broken because it needs to load my settings file and the theme's settings file. End of side note :)

Steps:

  • Open a .md file in Explorer view
  • Add a "_simpleNotice" using snippet feature (scissors icon opening my snippets library) , this will add the following:
{{% notice style="primary" %}}

{{% /notice %}}
  • Paste following content between the tags:
Les poèmes qui commencent par ces deux premiers vers...
{{% include "../../includes/quand_un_avion_trace" hidefirstheading %}}
  • Being still on the same .md file, click in sidebar to active FM view.
  • Then paste same content into "info" custom field whose title is "Additional description" in FM.
  • Observe the magic pasting as below... I am not sure whether I saved the .md file before switching views but think I did not.

Image

Edit: Oops I think Copilot was enabled back after reinstalling computer. But so we have one case.

Second edit: Double checked: no, Copilot isn't listed in installed extensions... Fine

Great, I could reproduce it with rather simple steps. I attach a recording at time I noticed the magic pasting happening. Since you forked my site to fix front matter settings, I think you can continue playing with it. However I should add a note to README to clone the Hugo theme else Front Matter is broken because it needs to load my settings file and the theme's settings file. End of side note :) **Steps:** - Open a .md file in Explorer view - Add a "_simpleNotice" using snippet feature (scissors icon opening my snippets library) , this will add the following: ``` {{% notice style="primary" %}} {{% /notice %}} ``` - Paste following content between the tags: ``` Les poèmes qui commencent par ces deux premiers vers... {{% include "../../includes/quand_un_avion_trace" hidefirstheading %}} ``` - Being still on the same .md file, click in sidebar to active FM view. - Then paste same content into "info" custom field whose title is "Additional description" in FM. - Observe the magic pasting as below... I am not sure whether I saved the .md file before switching views but think I did not. ![Image](https://github.com/user-attachments/assets/9778198f-e7c8-4cb6-b3e0-51e9d09612be) **Edit:** Oops I think Copilot was enabled back after reinstalling computer. But so we have one case. **Second edit:** Double checked: no, Copilot isn't listed in installed extensions... Fine <!-- github-comment-id:3085365769 -->
Author
Owner

Well, editing some content today, I think I got it. FM's view is activated but I update content manually by typing or pasting text in right panel.

First, I edited a text whose "info" custom field, in YAML format, contains:

info = """
Les poèmes qui commencent par ce vers...
{{% include "../../includes/l_automne_est_venu" hidefirstheading %}}"""

I manually edited to:

info = '{{% include "../../includes/l_automne_est_venu" hidefirstheading %}}'

And also pasted at the end of the file:

{{% notice style="primary" %}}
{{% include "../../includes/l_automne_est_venu" hidefirstheading %}}
{{% /notice %}}

When opening the second file, all of a sudden, the info field in FM metadata got updated with:

info = '{{% include "../../includes/l_automne_est_venu" hidefirstheading %}}'

...that come from my previous file editing but not my clipboard...

And that gets pasted to a third file I open.

Still version 10.9.0.

Well, editing some content today, I think I got it. FM's view is activated but I update content manually by typing or pasting text in right panel. First, I edited a text whose "info" custom field, in YAML format, contains: ``` info = """ Les poèmes qui commencent par ce vers... {{% include "../../includes/l_automne_est_venu" hidefirstheading %}}""" ``` I manually edited to: `info = '{{% include "../../includes/l_automne_est_venu" hidefirstheading %}}'` And also pasted at the end of the file: ``` {{% notice style="primary" %}} {{% include "../../includes/l_automne_est_venu" hidefirstheading %}} {{% /notice %}} ``` When opening the second file, all of a sudden, the info field in FM metadata got updated with: `info = '{{% include "../../includes/l_automne_est_venu" hidefirstheading %}}'` ...that come from my previous file editing but not my clipboard... And that gets pasted to a third file I open. Still version 10.9.0. <!-- github-comment-id:3288807240 -->
Author
Owner

I'm still monitoring the magic pasting accompanied by \r\n additions, since I use beta version of FM. It often happens after I paste the following in the info metadata text field into an existing document from one that has this field filled, then open a third document:

{{% include "../../includes/coupe_et_je_repousse" hidefirstheading %}}

Today right before restarting extensions to update to version 10.11.273993268 I saw another interesting weirdness... but I haven't updated FM since June 7 so the active version is uncertain but was released no later than June 7 in the evening. So you can guess which version I used.

This time, pasting into info field produced a weird continuous refresh behavior, as recorded as attachment...

I haven't seen this before and wonder whether it will happen again.

Image

I keep monitoring :-)

I'm still monitoring the magic pasting accompanied by \r\n additions, since I use beta version of FM. It often happens after I paste the following in the info metadata text field into an existing document from one that has this field filled, then open a third document: `{{% include "../../includes/coupe_et_je_repousse" hidefirstheading %}}` Today right before restarting extensions to update to version 10.11.273993268 I saw another interesting weirdness... but I haven't updated FM since June 7 so the active version is uncertain but was released no later than June 7 in the evening. So you can guess which version I used. This time, pasting into info field produced a weird continuous refresh behavior, as recorded as attachment... I haven't seen this before and wonder whether it will happen again. <img width="1911" height="1246" alt="Image" src="https://github.com/user-attachments/assets/467e2d52-ec24-49f6-93fe-8667bc9326d0" /> I keep monitoring :-) <!-- github-comment-id:4758198898 -->
Author
Owner

I confirm flickering/infinite refresh without content changes occurs with version 10.11.273993268, all of a sudden, pasting into Information field in FM produces this. Let's restart the extension to fix it. Mmh, no, had to restart VS Code.

Flickering looks many times speedier than initial magic carriage returns additions but it means something has been fixed lately.
But a magic pasting of info field to another opened file finally also occurred.

I've been working on Windows 11 and create new files from VS Code so it uses default encoding.

I confirm flickering/infinite refresh without content changes occurs with version 10.11.273993268, all of a sudden, pasting into Information field in FM produces this. Let's restart the extension to fix it. Mmh, no, had to restart VS Code. Flickering looks many times speedier than initial magic carriage returns additions but it means something has been fixed lately. But a magic pasting of info field to another opened file finally also occurred. I've been working on Windows 11 and create new files from VS Code so it uses default encoding. <!-- github-comment-id:4758749025 -->
Author
Owner

Still need to find a way to be able to reproduce it so that I can find the root cause. I have let AI check, and it found an issue. The new beta is being released at the moment. Can you check the version 10.11.279432408 to see if that did anything?

Still need to find a way to be able to reproduce it so that I can find the root cause. I have let AI check, and it found an issue. The new beta is being released at the moment. Can you check the version `10.11.279432408` to see if that did anything? <!-- github-comment-id:4766953685 -->
Author
Owner

Just updated to version 10.11.279448739.
Got the flickering bug again (comment from 2 days ago).

Steps:

My questions:

  • What did AI found for an issue?
  • What does FM do when I fill in my custom text field? Some parsing, then refresh the viewed file. Does it dislike some characters I pasted?
Just updated to version 10.11.279448739. Got the flickering bug again (comment from 2 days ago). Steps: - open a file: typically this one: https://raw.githubusercontent.com/poesieland/poesieland.github.io/refs/heads/main/content/fr/seasons/33_trente_troisieme_saison/les_bleus_du_ciel.md - Copy the following text from the file viewed in text editor: {{% include "../../includes/la_nuit_faite_mer" hidefirstheading %}} - Open another file - Switch to FM view - Paste the copied text to the Information custom field. My questions: - What did AI found for an issue? - What does FM do when I fill in my custom text field? Some parsing, then refresh the viewed file. Does it dislike some characters I pasted? <!-- github-comment-id:4772243356 -->
Author
Owner

What did AI found for an issue?

It found an issue in an on-change event that wasn't tracked, which could cause this issue. On my end, I didn't see a change.

What does FM do when I fill in my custom text field? Some parsing, then refresh the viewed file. Does it dislike some characters I pasted?

When you fill in a text field, FM debounces your input (300ms), then sends the new value to the extension host, which reads the current front matter, updates that field, re-serialises to YAML, and replaces the whole file. The panel then re-reads the file and refreshes.

> What did AI found for an issue? It found an issue in an on-change event that wasn't tracked, which could cause this issue. On my end, I didn't see a change. > What does FM do when I fill in my custom text field? Some parsing, then refresh the viewed file. Does it dislike some characters I pasted? When you fill in a text field, FM debounces your input (300ms), then sends the new value to the extension host, which reads the current front matter, updates that field, re-serialises to YAML, and replaces the whole file. The panel then re-reads the file and refreshes. <!-- github-comment-id:4777469235 -->
Author
Owner

Thanks for the steps! I found the issue, as you use {{}}, FM tries to replace it with a placeholder, as the fields have this logic. This results in an endless loop. I implemented a fix and releasing it right now to the BETA version.

Thanks for the steps! I found the issue, as you use `{{}}`, FM tries to replace it with a placeholder, as the fields have this logic. This results in an endless loop. I implemented a fix and releasing it right now to the BETA version. <!-- github-comment-id:4777541319 -->
Author
Owner

Thank you so much, it's fixed 👍

Thank you so much, it's fixed 👍 <!-- github-comment-id:4783108051 -->
Author
Owner

EDIT:
I got it, FM is confused when there is more than one custom field. I see that when I edit a third field, everything gets messy and the three text fields gain carriage returns. Maybe I have some misconfiguration?

Original description written tonight:
Oh... The bug is somewhat back... when copy-pasting from a FM text field to another one the following, I see newlines appearing as the pasted text is processed. Strange, no?

Exact behavior:

  1. I added a "wordcloud" new text fiield
  2. I copy the content of "description" field below to "wordcloud"
  3. Newlines are added to "description" field I copy from...
  4. Behavior ceases when I save the file
  5. I may see newlines added to the "wordcloud" field too when I fix the "description" field.

Multiline text to copy from one field to another one:

Voici janvier pâle et frileux
Voici janvier, ce chien galeux !
Voici janvier, frileux et pâle !

Image Image
**EDIT**: I got it, FM is confused when there is more than one custom field. I see that when I edit a third field, everything gets messy and the three text fields gain carriage returns. Maybe I have some misconfiguration? **Original description written tonight:** Oh... The bug is somewhat back... when copy-pasting from a FM text field to another one the following, I see newlines appearing as the pasted text is processed. Strange, no? Exact behavior: 1. I added a "wordcloud" new text fiield 2. I copy the content of "description" field below to "wordcloud" 3. Newlines are added to "description" field I copy from... 4. Behavior ceases when I save the file 5. I may see newlines added to the "wordcloud" field too when I fix the "description" field. Multiline text to copy from one field to another one: Voici janvier pâle et frileux Voici janvier, ce chien galeux ! Voici janvier, frileux et pâle ! <img width="1182" height="570" alt="Image" src="https://github.com/user-attachments/assets/90b5a39f-4b6b-43d7-a9ba-2f35336fcde7" /> <img width="875" height="382" alt="Image" src="https://github.com/user-attachments/assets/89380672-87c7-4828-8e6b-ad239e5f86f9" /> <!-- github-comment-id:4883709773 -->
Author
Owner

@postb99, this is a different issue and has to do with the parser that is used (although I can't reproduce it with the steps you mentioned).

Do you see the same happening in YAML? As in the screenshot, you're using TOML.

https://github.com/user-attachments/assets/f2e22100-3bc0-41a5-be43-886728114607

@postb99, this is a different issue and has to do with the parser that is used (although I can't reproduce it with the steps you mentioned). Do you see the same happening in YAML? As in the screenshot, you're using TOML. https://github.com/user-attachments/assets/f2e22100-3bc0-41a5-be43-886728114607 <!-- github-comment-id:4913330004 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#745