fix bugs in new function for moving cursor upwards, taking care to calculate column different if on first line (where there is no preceding newline) vs any line other than the first
This commit is contained in:
@@ -303,22 +303,6 @@ struct
|
||||
in
|
||||
Expect.isTrue isSkipped
|
||||
end)
|
||||
, test "moves to 0 of buffer when on first line" (fn _ =>
|
||||
let
|
||||
(* arrange *)
|
||||
val str = "hello \nworld \ntime to go\n"
|
||||
val buffer = LineGap.fromString str
|
||||
val app = TestUtils.init buffer
|
||||
val app = AppWith.idx (app, 5)
|
||||
|
||||
(* act *)
|
||||
val {cursorIdx, ...} = TestUtils.update (app, CHAR_EVENT #"k")
|
||||
|
||||
(* assert *)
|
||||
val isAtStart = cursorIdx = 0
|
||||
in
|
||||
Expect.isTrue isAtStart
|
||||
end)
|
||||
, test "leaves cursor at same idx when already at start of buffer" (fn _ =>
|
||||
let
|
||||
(* arrange *)
|
||||
|
||||
Reference in New Issue
Block a user