micro-editor / micro-editor/micro
.patch file highlighted as mail
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29.6k
- Forks
- 1.4k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 10
Description
Description of the problem or steps to reproduce
A .patch file will be highlighted as mail if it starts with the patch magic line:
From {commit hash} Mon Sep 17 00:00:00 2001
(The date and time is exactly Mon Sep 17 00:00:00 2001 for all patches)
One would expect micro to first try highlighting that file with the patch filetype since it has the .patch extension. But micro instead highlights it as mail since it matches the header rule for mail.
Specifications
$ micro --version
Version: 2.0.11-dev.59
Commit hash: c57c5c04
Compiled on May 23, 2022
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
Start by tracing micro's filetype detection for .patch files and the mail header rule, using the supplied Git patch magic line as the reproduction case. Confirm why the mail rule takes precedence over the patch extension, then adjust the relevant behavior so .patch files are recognized as patch and verify the example no longer selects mail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100