patch 8.2.3903: "gM" does not count tabs as expected
Problem: "gM" does not count tabs as expected.
Solution: Use linetabsize() instead of mb_string2cells(). (closes #9409)
diff --git a/src/normal.c b/src/normal.c
index 1e887ca..f925aa1 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -6122,14 +6122,9 @@
case 'M':
{
- char_u *ptr = ml_get_curline();
-
oap->motion_type = MCHAR;
oap->inclusive = FALSE;
- if (has_mbyte)
- i = mb_string2cells(ptr, (int)STRLEN(ptr));
- else
- i = (int)STRLEN(ptr);
+ i = linetabsize(ml_get_curline());
if (cap->count0 > 0 && cap->count0 <= 100)
coladvance((colnr_T)(i * cap->count0 / 100));
else