- 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
master
Chris Allegretta 2002-03-29 15:15:38 +00:00
parent e373909037
commit f3a07b2d7e
2 changed files with 5 additions and 6 deletions

View File

@ -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:

View File

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