mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 14:55:38 -04:00
Merge pull request #3689 from Neko-Box-Coder/BetterSaveCmd
Some checks failed
Build and Test / test (1.19.x, macos-latest) (push) Has been cancelled
Build and Test / test (1.19.x, ubuntu-latest) (push) Has been cancelled
Build and Test / test (1.19.x, windows-latest) (push) Has been cancelled
Build and Test / test (1.23.x, macos-latest) (push) Has been cancelled
Build and Test / test (1.23.x, ubuntu-latest) (push) Has been cancelled
Build and Test / test (1.23.x, windows-latest) (push) Has been cancelled
Some checks failed
Build and Test / test (1.19.x, macos-latest) (push) Has been cancelled
Build and Test / test (1.19.x, ubuntu-latest) (push) Has been cancelled
Build and Test / test (1.19.x, windows-latest) (push) Has been cancelled
Build and Test / test (1.23.x, macos-latest) (push) Has been cancelled
Build and Test / test (1.23.x, ubuntu-latest) (push) Has been cancelled
Build and Test / test (1.23.x, windows-latest) (push) Has been cancelled
Updating SaveCmd to use saveBufToFile instead
This commit is contained in:
commit
fa317456e9
@ -1042,7 +1042,6 @@ func (h *BufPane) saveBufToFile(filename string, action string, callback func())
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
InfoBar.Error(err)
|
InfoBar.Error(err)
|
||||||
} else {
|
} else {
|
||||||
h.Buf.SetName(filename)
|
|
||||||
InfoBar.Message("Saved " + filename)
|
InfoBar.Message("Saved " + filename)
|
||||||
if callback != nil {
|
if callback != nil {
|
||||||
callback()
|
callback()
|
||||||
@ -1067,7 +1066,6 @@ func (h *BufPane) saveBufToFile(filename string, action string, callback func())
|
|||||||
InfoBar.Error(err)
|
InfoBar.Error(err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
h.Buf.SetName(filename)
|
|
||||||
InfoBar.Message("Saved " + filename)
|
InfoBar.Message("Saved " + filename)
|
||||||
if callback != nil {
|
if callback != nil {
|
||||||
callback()
|
callback()
|
||||||
|
@ -907,10 +907,7 @@ func (h *BufPane) SaveCmd(args []string) {
|
|||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
h.Save()
|
h.Save()
|
||||||
} else {
|
} else {
|
||||||
err := h.Buf.SaveAs(args[0])
|
h.saveBufToFile(args[0], "SaveAs", nil)
|
||||||
if err != nil {
|
|
||||||
InfoBar.Error(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user