$NetBSD: patch-af,v 1.1 1999/01/25 19:41:37 tron Exp $ --- Widgets/ArtText.c.orig Fri Jan 9 18:16:12 1998 +++ Widgets/ArtText.c Mon Jan 25 20:29:37 1999 @@ -476,7 +476,7 @@ if (str[i] != '\t') res[j++] = str[i]; else { - int m = 8 - (j & 7); + int m = 7 - (j % 8); while (m-- >= 0) res[j++] = ' '; @@ -1750,16 +1750,17 @@ { ArtTextWidget w = (ArtTextWidget)gw; TSNode *node; - long n; + long n,j=0; for (n = 0 ; str[n] != '\0' ; n++) { if (str[n] == '\t') { - long i = 8 - (n % 8); + long i = 7 - ((n + j) % 8); - if (sel_start > n) + if (sel_start > (n + j)) sel_start += i; - if (sel_stop > n) + if (sel_stop > (n + j)) sel_stop += i; + j += i; } }