mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-16 20:31:02 +00:00
parent
3b4521e9c6
commit
6aab17f445
2 changed files with 3 additions and 1 deletions
|
|
@ -65,6 +65,7 @@ type Cursor struct {
|
|||
// It's just a simple wrapper of FromCharPos
|
||||
func (c *Cursor) SetLoc(loc int) {
|
||||
c.x, c.y = FromCharPos(loc, c.v.buf)
|
||||
c.lastVisualX = c.GetVisualX()
|
||||
}
|
||||
|
||||
// Loc gets the cursor location in terms of character number instead
|
||||
|
|
|
|||
|
|
@ -286,7 +286,8 @@ func (v *View) OpenFile() {
|
|||
messenger.Error(err.Error())
|
||||
return
|
||||
}
|
||||
v.buf = NewBuffer(string(file), filename)
|
||||
buf := NewBuffer(string(file), filename)
|
||||
v.OpenBuffer(buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue