mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 22:27:13 +09:00
Merge
This commit is contained in:
@@ -249,7 +249,7 @@ func (v *View) CursorRight(usePlugin bool) bool {
|
||||
}
|
||||
|
||||
if v.Cursor.HasSelection() {
|
||||
v.Cursor.Loc = v.Cursor.CurSelection[1].Move(-1, v.Buf)
|
||||
v.Cursor.Loc = v.Cursor.CurSelection[1]
|
||||
v.Cursor.ResetSelection()
|
||||
v.Cursor.StoreVisualX()
|
||||
} else {
|
||||
@@ -347,7 +347,7 @@ func (v *View) SelectLeft(usePlugin bool) bool {
|
||||
}
|
||||
|
||||
loc := v.Cursor.Loc
|
||||
count := v.Buf.End().Move(-1, v.Buf)
|
||||
count := v.Buf.End()
|
||||
if loc.GreaterThan(count) {
|
||||
loc = count
|
||||
}
|
||||
@@ -370,7 +370,7 @@ func (v *View) SelectRight(usePlugin bool) bool {
|
||||
}
|
||||
|
||||
loc := v.Cursor.Loc
|
||||
count := v.Buf.End().Move(-1, v.Buf)
|
||||
count := v.Buf.End()
|
||||
if loc.GreaterThan(count) {
|
||||
loc = count
|
||||
}
|
||||
|
||||
@@ -249,20 +249,20 @@ func (c *Cursor) RuneUnder(x int) rune {
|
||||
func (c *Cursor) UpN(amount int) {
|
||||
proposedY := c.Y - amount
|
||||
if proposedY < 0 {
|
||||
proposedY = 0
|
||||
c.X = 0 // first line: X moved before the first character
|
||||
return
|
||||
} else if proposedY >= c.buf.NumLines {
|
||||
proposedY = c.buf.NumLines - 1
|
||||
}
|
||||
if proposedY == c.Y {
|
||||
return
|
||||
|
||||
runes := []rune(c.buf.Line(c.Y))
|
||||
c.X = c.GetCharPosInLine(proposedY, c.LastVisualX)
|
||||
|
||||
if c.X > len(runes) || proposedY == c.Y {
|
||||
c.X = len(runes)
|
||||
}
|
||||
|
||||
c.Y = proposedY
|
||||
runes := []rune(c.buf.Line(c.Y))
|
||||
c.X = c.GetCharPosInLine(c.Y, c.LastVisualX)
|
||||
if c.X > len(runes) {
|
||||
c.X = len(runes)
|
||||
}
|
||||
}
|
||||
|
||||
// DownN moves the cursor down N lines (if possible)
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user