nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit f3a07b2d7ea2f2f9a4071d729a7960322eca0922
parent e3739090376cece1aad1e7c21fce9d4e61774fc7
Author: Chris Allegretta <chrisa@asty.org>
Date:   Fri, 29 Mar 2002 15:15:38 +0000

- winio.c:do_cursorpos() - Make col numbering start from 1 (suggested by Andrew Ho)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1155 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 2++
Mwinio.c | 9+++------
2 files changed, 5 insertions(+), 6 deletions(-)

diff --git 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 @@ -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;