simplify one part of cursor.sml's 'startViK' function, by calling 'helpVi0' rather than 'helpViK' when we know previous char is \n
This commit is contained in:
@@ -566,16 +566,12 @@ struct
|
|||||||
(* \n -> \n *)
|
(* \n -> \n *)
|
||||||
cursorIdx
|
cursorIdx
|
||||||
else
|
else
|
||||||
(* non-graphical-chr -> \n *)
|
(* non-graphical-chr -> \n
|
||||||
let
|
* Since we know strIdx - 1 is \n
|
||||||
val lineColumn = getCursorColumn (lg, cursorIdx)
|
* that means we are at start of line
|
||||||
in
|
* so we can simply go to the end of the previous line *)
|
||||||
helpViK
|
helpVi0
|
||||||
( strIdx, shd, cursorIdx
|
(strIdx - 2, shd, cursorIdx - 2, leftStrings, leftLines)
|
||||||
, lineColumn, lineColumn, false
|
|
||||||
, leftStrings, lhd, leftLines
|
|
||||||
)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
(* strIdx - 1 is in leftStrings *)
|
(* strIdx - 1 is in leftStrings *)
|
||||||
case (leftStrings, leftLines) of
|
case (leftStrings, leftLines) of
|
||||||
|
|||||||
Reference in New Issue
Block a user