mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-11 07:02:44 +09:00
Minor bug fixes
This commit is contained in:
@@ -75,6 +75,7 @@ func (b *Buffer) Save() error {
|
||||
|
||||
// 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
|
||||
|
||||
@@ -11,7 +11,7 @@ func HandleCommand(input string, view *View) {
|
||||
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
|
||||
@@ -92,6 +92,6 @@ func HandleCommand(input string, view *View) {
|
||||
messenger.Message("Nothing matched " + search)
|
||||
}
|
||||
default:
|
||||
messenger.Error("Unknown command: " + cmd)
|
||||
messenger.Error("Unknown command: " + inputCmd)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ func (v *View) HandleEvent(event tcell.Event) {
|
||||
}
|
||||
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--
|
||||
|
||||
Reference in New Issue
Block a user