Merge pull request #3689 from Neko-Box-Coder/BetterSaveCmd

Updating SaveCmd to use saveBufToFile instead
This commit is contained in:
Dmytro Maluka
2025-03-12 22:11:51 +01:00
committed by GitHub
2 changed files with 1 additions and 6 deletions

View File

@@ -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()

View File

@@ -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)
}
}