From 1618cd58a1cf8743e2b6a2e78bd9d1c86cbd386f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Am=C3=A9lia=20Coutard-Sander?= Date: Sun, 12 Jan 2025 16:40:25 +0100 Subject: [PATCH] =?utf8?q?Am=C3=A9lioration=20du=20zoom/d=C3=A9zoom?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/modes.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/modes.ml b/bin/modes.ml index cb347c7..c752918 100644 --- a/bin/modes.ml +++ b/bin/modes.ml @@ -217,7 +217,7 @@ and Normal : (Mode with type initer = unit) = struct let update (EditorState (m, st)) n = let module M = (val m) in let chpos dx dy ({ pos = x, y; _ } as st) = { st with pos = (x + dx, y + dy) } in - let chsize ds ({ size; _ } as st) = { st with size = max (size + ds) 1 } in + let chsize ds ({ size; _ } as st) = { st with size = max (size + ds) 2 } in let chnum d { n } = { n = Some ((Option.value n ~default:0 * 10) + d) } in let ntimes { n } = let rec iter_n n f v = @@ -241,8 +241,8 @@ and Normal : (Mode with type initer = unit) = struct | 'h' -> (EditorState (m, ntimes n (chpos (-1) 0) st), Either.left { n = None }) | 'j' -> (EditorState (m, ntimes n (chpos 0 (-1)) st), Either.left { n = None }) | 'l' -> (EditorState (m, ntimes n (chpos 1 0) st), Either.left { n = None }) - | 'o' -> (EditorState (m, ntimes n (chsize 1) st), Either.left { n = None }) - | 'p' -> (EditorState (m, ntimes n (chsize (-1)) st), Either.left { n = None }) + | 'o' -> (EditorState (m, ntimes n (chsize (max 1 (st.size / 10))) st), Either.left { n = None }) + | 'p' -> (EditorState (m, ntimes n (chsize (-max 1 (st.size / 10))) st), Either.left { n = None }) | _ -> (EditorState (m, st), Either.left { n = None }) end -- 2.46.0