fix bug in 'NormalYank.yankRight' function. Instead of calling 'Int.max (endOfLineIdx, high)', we should call 'Int.min (endOfLineIdx, high)' because we are trying to get the smaller number, and not the largest.
This commit is contained in:
@@ -462,6 +462,7 @@ struct
|
|||||||
fun parseYankTerminal (str, count, app, chrCmd, time) =
|
fun parseYankTerminal (str, count, app, chrCmd, time) =
|
||||||
case chrCmd of
|
case chrCmd of
|
||||||
#"h" => NormalYank.yankLeft (app, count)
|
#"h" => NormalYank.yankLeft (app, count)
|
||||||
|
| #"l" => NormalYank.yankRight (app, count)
|
||||||
| #"y" => NormalYank.yankLine (app, count)
|
| #"y" => NormalYank.yankLine (app, count)
|
||||||
| #"0" => NormalYank.yankToStartOfLine app
|
| #"0" => NormalYank.yankToStartOfLine app
|
||||||
| #"w" => NormalYank.yankWhenMovingForward (app, Cursor.nextWord, count)
|
| #"w" => NormalYank.yankWhenMovingForward (app, Cursor.nextWord, count)
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ struct
|
|||||||
|
|
||||||
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
||||||
|
|
||||||
val max = Cursor.viDlr (buffer, cursorIdx, 1)
|
val endOfLineIdx = Cursor.viDlr (buffer, cursorIdx, 1)
|
||||||
val high = Cursor.viL (buffer, cursorIdx, count)
|
val high = Cursor.viL (buffer, cursorIdx, count)
|
||||||
val high = Int.max (high, max)
|
val high = Int.min (high, endOfLineIdx)
|
||||||
val length = high - cursorIdx
|
val length = high - cursorIdx
|
||||||
|
|
||||||
val buffer = LineGap.goToIdx (high, buffer)
|
val buffer = LineGap.goToIdx (high, buffer)
|
||||||
|
|||||||
Reference in New Issue
Block a user