Add SaveAs action and command

Fixes #340

You can bind the action `SaveAs` and if you provide an argument to
the `save` command it will save as. For example `> save test.txt`.
This commit is contained in:
Zachary Yedidia
2016-09-08 14:13:46 -04:00
parent 1739f0631a
commit 301e86a46e
5 changed files with 26 additions and 5 deletions

View File

@@ -237,8 +237,12 @@ func Quit(args []string) {
// Save saves the buffer in the main view
func Save(args []string) {
// Save the main view
CurView().Save(true)
if len(args) == 0 {
// Save the main view
CurView().Save(true)
} else {
CurView().Buf.SaveAs(args[0])
}
}
// Replace runs search and replace