Fix micro editor preset (#4156)
Some checks are pending
Continuous Integration / check-required-label (push) Waiting to run
Continuous Integration / ci - ${{matrix.os}} (~/.cache/go-build, ubuntu-latest) (push) Waiting to run
Continuous Integration / ci - ${{matrix.os}} (~\AppData\Local\go-build, windows-latest) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.20.0) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.22.5) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.23.0) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.25.1) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.30.8) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (latest) (push) Waiting to run
Continuous Integration / build (push) Waiting to run
Continuous Integration / check-codebase (push) Waiting to run
Continuous Integration / lint (push) Waiting to run
Continuous Integration / upload-coverage (push) Blocked by required conditions
Continuous Integration / check-for-fixups (push) Waiting to run
Codespell / Check for spelling errors (push) Waiting to run
Generate Sponsors README / deploy (push) Waiting to run

- **PR Description**

I don't know what was I thinking when making #3049, because Micro does
not actually support `--` as delimiter between options and files. As
such, when trying to edit files with `micro` set as editor, an empty
file named `--` would be open first.

This PR fixes this by explicitly defining a preset for `micro`. I've
double-tested it to make sure that it doesn't behave wierdly any more :D
This commit is contained in:
Stefan Haller 2025-01-09 08:51:39 +01:00 committed by GitHub
commit b8d5e481bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,9 +66,15 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset
return !ok
},
},
"lvim": standardTerminalEditorPreset("lvim"),
"emacs": standardTerminalEditorPreset("emacs"),
"micro": standardTerminalEditorPreset("micro"),
"lvim": standardTerminalEditorPreset("lvim"),
"emacs": standardTerminalEditorPreset("emacs"),
"micro": {
editTemplate: "micro {{filename}}",
editAtLineTemplate: "micro +{{line}} {{filename}}",
editAtLineAndWaitTemplate: "micro +{{line}} {{filename}}",
openDirInEditorTemplate: "micro {{dir}}",
suspend: returnBool(true),
},
"nano": standardTerminalEditorPreset("nano"),
"kakoune": standardTerminalEditorPreset("kak"),
"helix": {