mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-16 22:10:26 +00:00
Merge pull request #3689 from Neko-Box-Coder/BetterSaveCmd
Updating SaveCmd to use saveBufToFile instead
This commit is contained in:
commit
fa317456e9
2 changed files with 1 additions and 6 deletions
|
|
@ -1042,7 +1042,6 @@ func (h *BufPane) saveBufToFile(filename string, action string, callback func())
|
|||
if err != nil {
|
||||
InfoBar.Error(err)
|
||||
} else {
|
||||
h.Buf.SetName(filename)
|
||||
InfoBar.Message("Saved " + filename)
|
||||
if callback != nil {
|
||||
callback()
|
||||
|
|
@ -1067,7 +1066,6 @@ func (h *BufPane) saveBufToFile(filename string, action string, callback func())
|
|||
InfoBar.Error(err)
|
||||
}
|
||||
} else {
|
||||
h.Buf.SetName(filename)
|
||||
InfoBar.Message("Saved " + filename)
|
||||
if callback != nil {
|
||||
callback()
|
||||
|
|
|
|||
|
|
@ -907,10 +907,7 @@ func (h *BufPane) SaveCmd(args []string) {
|
|||
if len(args) == 0 {
|
||||
h.Save()
|
||||
} else {
|
||||
err := h.Buf.SaveAs(args[0])
|
||||
if err != nil {
|
||||
InfoBar.Error(err)
|
||||
}
|
||||
h.saveBufToFile(args[0], "SaveAs", nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue