diff --git a/ChangeLog b/ChangeLog index 021d7fac4a79aa7dea3d91c4d1fa31c69c787564..540ea9f46a19000ae879f705eb01a8bd6a2cc858 100644 --- a/ChangeLog +++ b/ChangeLog @@ -53,6 +53,8 @@ CVS code - - winio.c: do_credits() - Add Thomas Dickey. + do_cursorpos() + - Make col numbering start from 1 (suggested by Andrew Ho). update_line(), xpt() - Add check for 127 (DLR). - po/sv.po: diff --git a/winio.c b/winio.c index 1168e9e26690d351e007a5c1a054d19092950526..52e46f012945f173bfa59e289eeb9140009d7970 100644 --- a/winio.c +++ b/winio.c @@ -1607,10 +1607,7 @@ int do_cursorpos(int constant) if (old_totsize == -1) old_totsize = totsize; - if (strlen(current->data) == 0) - colpct = 0; - else - colpct = 100 * xplustabs() / xpt(current, strlen(current->data)); + colpct = 100 * (xplustabs() + 1) / (xpt(current, strlen(current->data)) + 1); for (fileptr = fileage; fileptr != current && fileptr != NULL; fileptr = fileptr->next) @@ -1640,8 +1637,8 @@ int do_cursorpos(int constant) if (!constant || (old_i != i || old_totsize != totsize)) { statusbar(_ ("line %d/%d (%.0f%%), col %ld/%ld (%.0f%%), char %ld/%ld (%.0f%%)"), - current->lineno, totlines, linepct, xplustabs(), - xpt(current, strlen(current->data)), colpct, i, j, bytepct); + current->lineno, totlines, linepct, xplustabs() + 1, + xpt(current, strlen(current->data)) + 1, colpct, i, j, bytepct); } old_i = i;