// SaveAs saves the buffer to a specified path (filename), creating the file if it does not exist
func (b *Buffer) SaveAs(filename string) error {
+ b.UpdateRules()
err := ioutil.WriteFile(filename, []byte(b.text), 0644)
if err == nil {
b.savedText = b.text
inputCmd := strings.Split(input, " ")[0]
args := strings.Split(input, " ")[1:]
- commands := []string{"set", "quit", "save"}
+ commands := []string{"set", "quit", "save", "replace"}
i := 0
cmd := inputCmd
messenger.Message("Nothing matched " + search)
}
default:
- messenger.Error("Unknown command: " + cmd)
+ messenger.Error("Unknown command: " + inputCmd)
}
}
}
case *tcell.EventMouse:
x, y := e.Position()
- x -= v.lineNumOffset + v.leftCol
+ x -= v.lineNumOffset - v.leftCol
y += v.topline
// Position always seems to be off by one
x--