Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight of first heredoc with quotes broken depending on how many characters exists before it #785

Closed
flaviovs opened this issue Jul 9, 2024 · 2 comments · Fixed by #786

Comments

@flaviovs
Copy link

flaviovs commented Jul 9, 2024

It took me some time to replicate this with a minimal example: when the file below loads, the single quote inside the heredoc is interpreted as an opening string, breaking the highlight from there downwards. Now the strangest things:

  • If I remove one single character before the heredoc, the file loads with highlighting working fine.
  • If I do any edit anywhere before the heredoc -- either adding or removing characters -- then highlighting is fixed.

Can anyone replicate this? Perhaps a font-lock issue?

<?php

//....................

class Test
{
    public function a12345678()
    {
        //........
        //................................................
        //........................
        //.....................................
        //....................................................
        //....
        //
    }

    public function a123456789012345678901()
    {
        // .................

        // ..............
        // ........
        // .

        echo <<<EOTXT
            I'm here.
            EOTXT;
    }

    public function notHighlighted()
    {
    }
}

Here's how it looks in my computer:

image

Stock Debian Emacs 28.2, php-mode-20240621.742 from ELPA.

@zonuexe
Copy link
Member

zonuexe commented Sep 11, 2024

@flaviovs Thank you for your report!

The number 500 is based on the default value of syntax-propertize-chunk-size, which was introduced in #531 to improve performance. Your report was an important clue to the problem with the previous approach.

We are very grateful for your bug report.

@flaviovs
Copy link
Author

Glad I could help. Thanks for looking into this, @zonuexe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants