Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions internal/action/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
5 changes: 1 addition & 4 deletions internal/action/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing action="SaveAs" will in the end cause executing onSaveAs lua callback, which is supposed to be executed by the SaveAs action, not by a command?

Copy link
Contributor Author

@Neko-Box-Coder Neko-Box-Coder Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the if block few lines above which calls Save() will also cause a lua callback. I don't mind either way to have an action or not.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the if block few lines above which calls Save() will also cause a lua callback. I don't mind either way to have an action or not.

Good point. Ok, maybe some users are already relying on that, so let's stay consistent with this inconsistency...

}
}

Expand Down