emacs-php / php-mode

A powerful and flexible Emacs major mode for editing PHP scripts
GNU General Public License v3.0
582 stars 117 forks source link

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

Open flaviovs opened 1 month ago

flaviovs commented 1 month ago

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:

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.