File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,10 @@ const (
29
29
commitMessage: "build, save, push"
30
30
31
31
committerName: "TIL Autobot"
32
- editor: "mvim "
32
+ editor: ""
33
33
targetDirectory: "~/Documents/til"
34
34
`
35
+ defaultEditor = "open"
35
36
36
37
fileExtension = "md"
37
38
@@ -407,9 +408,10 @@ func createNewPage(title string) string {
407
408
}
408
409
409
410
// Tell the OS to open the newly-created page in the editor (as specified in the config)
410
- editor , err1 := globalConfig .String ("editor" )
411
- if err1 != nil {
412
- Fail (err1 )
411
+ // If there's no editor explicitly defined by the user, tell the OS to try and open it
412
+ editor := globalConfig .UString ("editor" , defaultEditor )
413
+ if editor == "" {
414
+ editor = defaultEditor
413
415
}
414
416
415
417
cmd := exec .Command (editor , filePath )
You can’t perform that action at this time.
0 commit comments