From e40302e4dee93314f0889236288a078966fd8326 Mon Sep 17 00:00:00 2001 From: Hadeed Ahmad Date: Mon, 11 Sep 2023 16:12:07 +0500 Subject: [PATCH] Tweak cursor movement around tab characters --- src/erow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/erow.c b/src/erow.c index c47b3db..80ab112 100644 --- a/src/erow.c +++ b/src/erow.c @@ -77,6 +77,9 @@ int erow_rx_to_cx(struct erow *erow, int rx) { c_rx += KILO_TAB_STOP - (c_rx % KILO_TAB_STOP); else c_rx++; + + if (c_rx > rx) + break; } return cx;