Skip to content

Commit b8d5e48

Browse files
authored
Fix micro editor preset (#4156)
- **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
2 parents b2c46c3 + 2b3525b commit b8d5e48

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/config/editor_presets.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset
6666
return !ok
6767
},
6868
},
69-
"lvim": standardTerminalEditorPreset("lvim"),
70-
"emacs": standardTerminalEditorPreset("emacs"),
71-
"micro": standardTerminalEditorPreset("micro"),
69+
"lvim": standardTerminalEditorPreset("lvim"),
70+
"emacs": standardTerminalEditorPreset("emacs"),
71+
"micro": {
72+
editTemplate: "micro {{filename}}",
73+
editAtLineTemplate: "micro +{{line}} {{filename}}",
74+
editAtLineAndWaitTemplate: "micro +{{line}} {{filename}}",
75+
openDirInEditorTemplate: "micro {{dir}}",
76+
suspend: returnBool(true),
77+
},
7278
"nano": standardTerminalEditorPreset("nano"),
7379
"kakoune": standardTerminalEditorPreset("kak"),
7480
"helix": {

0 commit comments

Comments
 (0)