From cccb21df3b4c6fe0aaa99743c418aa973aeebad0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 04:10:59 +0200 Subject: Merging upstream version 2:9.1.0374. Signed-off-by: Daniel Baumann --- src/indent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/indent.c') diff --git a/src/indent.c b/src/indent.c index 56032fa..1dfde7d 100644 --- a/src/indent.c +++ b/src/indent.c @@ -163,7 +163,7 @@ tabstop_start(colnr_T col, int ts, int *vts) int excess; if (vts == NULL || vts[0] == 0) - return (col / ts) * ts; + return col - col % ts; tabcount = vts[0]; for (t = 1; t <= tabcount; ++t) @@ -174,7 +174,7 @@ tabstop_start(colnr_T col, int ts, int *vts) } excess = tabcol % vts[tabcount]; - return excess + ((col - excess) / vts[tabcount]) * vts[tabcount]; + return col - (col - excess) % vts[tabcount]; } /* -- cgit v1.2.3