mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-13 13:59:06 +02:00
Clean up helix editor preset
This commit is contained in:
parent
e5534d9781
commit
9c384c5267
@ -44,7 +44,12 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset
|
|||||||
"emacs": standardTerminalEditorPreset("emacs"),
|
"emacs": standardTerminalEditorPreset("emacs"),
|
||||||
"nano": standardTerminalEditorPreset("nano"),
|
"nano": standardTerminalEditorPreset("nano"),
|
||||||
"kakoune": standardTerminalEditorPreset("kakoune"),
|
"kakoune": standardTerminalEditorPreset("kakoune"),
|
||||||
"hx": helixEditorPreset(),
|
"helix": {
|
||||||
|
editTemplate: "hx -- {{filename}}",
|
||||||
|
editAtLineTemplate: "hx -- {{filename}}:{{line}}",
|
||||||
|
editAtLineAndWaitTemplate: "hx -- {{filename}}:{{line}}",
|
||||||
|
editInTerminal: true,
|
||||||
|
},
|
||||||
"vscode": {
|
"vscode": {
|
||||||
editTemplate: "code --reuse-window -- {{filename}}",
|
editTemplate: "code --reuse-window -- {{filename}}",
|
||||||
editAtLineTemplate: "code --reuse-window --goto -- {{filename}}:{{line}}",
|
editAtLineTemplate: "code --reuse-window --goto -- {{filename}}:{{line}}",
|
||||||
@ -74,6 +79,7 @@ func getPreset(osConfig *OSConfig, guessDefaultEditor func() string) *editPreset
|
|||||||
// Some of our presets have a different name than the editor they are using.
|
// Some of our presets have a different name than the editor they are using.
|
||||||
editorToPreset := map[string]string{
|
editorToPreset := map[string]string{
|
||||||
"kak": "kakoune",
|
"kak": "kakoune",
|
||||||
|
"hx": "helix",
|
||||||
"code": "vscode",
|
"code": "vscode",
|
||||||
"subl": "sublime",
|
"subl": "sublime",
|
||||||
"xed": "xcode",
|
"xed": "xcode",
|
||||||
@ -105,15 +111,6 @@ func standardTerminalEditorPreset(editor string) *editPreset {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func helixEditorPreset() *editPreset {
|
|
||||||
return &editPreset{
|
|
||||||
editTemplate: "hx -- {{filename}}",
|
|
||||||
editAtLineTemplate: "hx -- {{filename}}:{{line}}",
|
|
||||||
editAtLineAndWaitTemplate: "hx -- {{filename}}:{{line}}",
|
|
||||||
editInTerminal: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getEditInTerminal(osConfig *OSConfig, preset *editPreset) bool {
|
func getEditInTerminal(osConfig *OSConfig, preset *editPreset) bool {
|
||||||
if osConfig.EditInTerminal != nil {
|
if osConfig.EditInTerminal != nil {
|
||||||
return *osConfig.EditInTerminal
|
return *osConfig.EditInTerminal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user