micro-editor / micro-editor/micro
syntax highlighting fails on certain columns and line widths
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29.6k
- Forks
- 1.4k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 10
Description
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: d38f0dfe
- OS: debian 13 (bookworm)
- Terminal: gnome-terminal
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the YAML syntax-highlighting rules and the listed lines, varying the positions of //, TODO, and the line width. Trace the syntax-highlighting behavior responsible for column- and width-dependent matching. Done means all shown cases highlight the comment and TODO consistently, with regression coverage for the reported positions and widths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100