mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user