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

Updating SaveCmd to use saveBufToFile instead
This commit is contained in:
Dmytro Maluka 2025-03-12 22:11:51 +01:00 committed by GitHub
commit fa317456e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 { 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()

View File

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