Skip to content

syntax highlighting fails on certain columns and line widths #4018

@redsti-github

Description

@redsti-github

Description

Using the following syntax highlighting rules:

filetype: highlight_test

detect:
    filename: "(\\.(test)$)"

rules:
    - comment:
        start: "//"
        end: "$"
        rules:
            - todo: "TODO"

The following highlights correctly:

// TODO: feed the cat
// TODO: walk the dog

However, the following does not:

xxxx//xTODO:
xxxx//xTODO 
xxxx//xTODOx
xxxx//xxTODO
xxx//xTODO
xx//TODO
xxxxx//xxxTODO
xxxxx//xxTODOx
xxxxx//xTODOxx

Some experimenting shows that only the positions of the "//" and "TODO" matter, as well as the line width. "x"s can be replaced with any other characters.
Line position doesn't seem to matter.

Environment

  • Version: 2.0.16-dev.20
  • Commit hash: d38f0df
  • OS: debian 13 (bookworm)
  • Terminal: gnome-terminal

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions