diff options
-rw-r--r-- | lib/editor.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/editor.ml b/lib/editor.ml index a516b25..959b3af 100644 --- a/lib/editor.ml +++ b/lib/editor.ml | |||
@@ -72,8 +72,8 @@ module Action = struct | |||
72 | match Option.map ~f:Buffer.cursor e.buffer with | 72 | match Option.map ~f:Buffer.cursor e.buffer with |
73 | | None -> { e with cursor = (1, 1); offset = (0, 0) } | 73 | | None -> { e with cursor = (1, 1); offset = (0, 0) } |
74 | | Some (cx, cy) -> | 74 | | Some (cx, cy) -> |
75 | let dx' = Int.clamp_exn ~min:(cx - rs) ~max:cx dx | 75 | let dx' = Int.clamp_exn ~min:(cx - rs + 1) ~max:cx dx |
76 | and dy' = Int.clamp_exn ~min:(cy - cs) ~max:cy dy in | 76 | and dy' = Int.clamp_exn ~min:(cy - cs + 1) ~max:cy dy in |
77 | { e with cursor = (cx - dx' + 1, cy - dy' + 1); offset = (dx', dy') } | 77 | { e with cursor = (cx - dx' + 1, cy - dy' + 1); offset = (dx', dy') } |
78 | in | 78 | in |
79 | modify ~f:aux | 79 | modify ~f:aux |