mirror of
https://github.com/jroimartin/gocui.git
synced 2025-04-28 13:48:51 +08:00
Revert changes in *View.MoveCursor
This commit is contained in:
parent
d822523f8c
commit
4e9ce9a8e2
4
edit.go
4
edit.go
@ -137,7 +137,7 @@ func (v *View) MoveCursor(dx, dy int, writeMode bool) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if y >= 0 && y < len(v.viewLines) {
|
if y >= 0 && y < len(v.viewLines) {
|
||||||
curLineWidth = len(v.viewLines[y].line) - 1
|
curLineWidth = len(v.viewLines[y].line)
|
||||||
if v.Wrap && curLineWidth >= maxX {
|
if v.Wrap && curLineWidth >= maxX {
|
||||||
curLineWidth = maxX - 1
|
curLineWidth = maxX - 1
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ func (v *View) MoveCursor(dx, dy int, writeMode bool) {
|
|||||||
}
|
}
|
||||||
// get the width of the previous line
|
// get the width of the previous line
|
||||||
if y-1 >= 0 && y-1 < len(v.viewLines) {
|
if y-1 >= 0 && y-1 < len(v.viewLines) {
|
||||||
prevLineWidth = len(v.viewLines[y-1].line) - 1
|
prevLineWidth = len(v.viewLines[y-1].line)
|
||||||
} else {
|
} else {
|
||||||
prevLineWidth = 0
|
prevLineWidth = 0
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user