change line indexing in AppUpdate.moveToLine from 0-based to 1-based (so first line can be access with 1G, second with 2G, as is normal with Vim)
This commit is contained in:
@@ -69,8 +69,13 @@ struct
|
||||
val bufferLine = bufferLine - 1
|
||||
|
||||
val buffer = LineGap.goToIdx (bufferIdx, buffer)
|
||||
val bufferLine = TextWindow.getStartLineWithCursorCentered
|
||||
(buffer, bufferIdx, bufferLine, windowWidth, windowHeight)
|
||||
val bufferLine =
|
||||
let
|
||||
val maxHeight = windowHeight - (TextConstants.ySpace * 2)
|
||||
in
|
||||
TextWindow.getStartLineWithCursorCentered
|
||||
(buffer, bufferIdx, bufferLine, windowWidth, maxHeight)
|
||||
end
|
||||
|
||||
val buffer = LineGap.goToLine (bufferLine, buffer)
|
||||
val drawMsg =
|
||||
@@ -85,6 +90,9 @@ struct
|
||||
end
|
||||
|
||||
fun moveToLine (app: app_type, reqLine) =
|
||||
if reqLine = 0 then
|
||||
moveToStart app
|
||||
else
|
||||
let
|
||||
val {windowWidth, windowHeight, buffer, startLine = origLine, ...} = app
|
||||
val buffer = LineGap.goToLine (reqLine, buffer)
|
||||
@@ -285,7 +293,7 @@ struct
|
||||
if String.size str = 0 then
|
||||
moveToEnd app
|
||||
else
|
||||
moveToLine (app, count)
|
||||
moveToLine (app, count - 1)
|
||||
| #"%" => moveToMatchingPair app
|
||||
(* multi-char commands which can be appended *)
|
||||
| #"t" => appendChr (app, chr, str)
|
||||
|
||||
Reference in New Issue
Block a user