Skip to content

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

Closed
@flaviovs

Description

@flaviovs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions