From 98dc438fa570fb00663a5aedd9e138f07a876bf8 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Tue, 8 Jan 2019 23:28:49 -0500 Subject: [PATCH] vt100: up/down/left/right were always limited to 1 position. fixed. --- Emulators/VT100.mm.ragel | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Emulators/VT100.mm.ragel b/Emulators/VT100.mm.ragel index 652bb79..f5b3332 100644 --- a/Emulators/VT100.mm.ragel +++ b/Emulators/VT100.mm.ragel @@ -84,7 +84,7 @@ # action cursor_up { /* cursor up */ - unsigned count = _flags.DECANM ? std::min(1u, _args.front()) : 1; + unsigned count = _flags.DECANM ? std::max(1u, _args.front()) : 1; if (cursor_in_region()) { cursor.y = clamp(cursor.y - count, region_y.first, region_y.second); @@ -94,7 +94,7 @@ } action cursor_down { /* cursor down */ - unsigned count = _flags.DECANM ? std::min(1u, _args.front()) : 1; + unsigned count = _flags.DECANM ? std::max(1u, _args.front()) : 1; if (cursor_in_region()) { cursor.y = clamp(cursor.y + count, region_y.first, region_y.second); @@ -105,13 +105,13 @@ action cursor_left { /* cursor left */ - unsigned count = _flags.DECANM ? std::min(1u, _args.front()) : 1; + unsigned count = _flags.DECANM ? std::max(1u, _args.front()) : 1; cursor.x = clamp(cursor.x - count, window_x.first, window_x.second); } action cursor_right { /* cursor right */ - unsigned count = _flags.DECANM ? std::min(1u, _args.front()) : 1; + unsigned count = _flags.DECANM ? std::max(1u, _args.front()) : 1; cursor.x = clamp(cursor.x + count, window_x.first, window_x.second); }