From c628a434f6c510ae37ffe18671b9dbd856f8cdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Wed, 27 May 2015 21:36:50 +0200 Subject: [PATCH] Fix the 31position test --- driver-csi.c | 2 +- tests/31position.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/driver-csi.c b/driver-csi.c index feedeb1..5701e19 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -378,7 +378,7 @@ handle_csi_R (termo_t *tk, termo_key_t *key, int cmd, long *arg, int args) return TERMO_RES_NONE; key->type = TERMO_TYPE_POSITION; - termo_key_set_linecol (key, arg[1], arg[0]); + termo_key_set_linecol (key, arg[0] - 1, arg[1] - 1); return TERMO_RES_KEY; default: diff --git a/tests/31position.c b/tests/31position.c index 7eb0eca..07ff09f 100644 --- a/tests/31position.c +++ b/tests/31position.c @@ -21,8 +21,8 @@ int main (int argc, char *argv[]) is_int (termo_interpret_position (tk, &key, &line, &col), TERMO_RES_KEY, "interpret_position yields RES_KEY"); - is_int (line, 15, "line for position report"); - is_int (col, 7, "column for position report"); + is_int (line, 14, "line for position report"); + is_int (col, 6, "column for position report"); // A plain CSI R is likely to be though. This is tricky :/ termo_push_bytes (tk, "\e[R", 3);