Skip to content

Fontification bug when editing indirect buffer #938

Description

@kings2u

I have a fontification problem when editing the text at https://gist.github.com/kings2u/6da981a7faf33ca5ace9aefd4e659f7a in markdown mode.

Expected Behavior

I would expect editing and pasting text into the indirect buffer to keep all fontification of headings and body text normal.

Actual Behavior & Steps to Reproduce

When I open the gist file with emacs -Q and place the cursor at the very beginning of the document and execute clone-indirect-buffer-other-window, and then in the new indirect buffer paste the text "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit," I get weird formatting in both the base buffer and the indirect buffer. The text "elementum purus" under Heading 1 has faces like markdown-header-delimeter-face and markdown-header-face-2 applied, and the text at the end of Heading 2 ("sapien. Maecenas tempor mi ac sem rhoncus dictum. Sed aliquet tincidunt arcu, eget mattis eros") has markdown-header-delimeter-face, markdown-header-face-3, and markdown-header-face-2 applied.

If instead the document is opened fresh and I run clone-indirect-buffer-other-window, and paste the text into the beginning of the BASE buffer instead of the indirect buffer, the formatting bug does not occur.

Another example of the problem: When I open the gist file with emacs -Q and place the cursor at the very beginning of the document and execute clone-indirect-buffer-other-window, and then in the new indirect buffer just type "hello," fontification gets messed up on the last characters of the body text at the end of Heading 1 and Heading 2.

Software Versions

markdown-show-version shows 2.8-alpha
emacs-version is 30.2
OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions