- 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
This commit is contained in:
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: - winio.c:
do_credits() do_credits()
- Add Thomas Dickey. - Add Thomas Dickey.
do_cursorpos()
- Make col numbering start from 1 (suggested by Andrew Ho).
update_line(), xpt() update_line(), xpt()
- Add check for 127 (DLR). - Add check for 127 (DLR).
- po/sv.po: - po/sv.po:

View File

@ -1607,10 +1607,7 @@ int do_cursorpos(int constant)
if (old_totsize == -1) if (old_totsize == -1)
old_totsize = totsize; old_totsize = totsize;
if (strlen(current->data) == 0) colpct = 100 * (xplustabs() + 1) / (xpt(current, strlen(current->data)) + 1);
colpct = 0;
else
colpct = 100 * xplustabs() / xpt(current, strlen(current->data));
for (fileptr = fileage; fileptr != current && fileptr != NULL; for (fileptr = fileage; fileptr != current && fileptr != NULL;
fileptr = fileptr->next) fileptr = fileptr->next)
@ -1640,8 +1637,8 @@ int do_cursorpos(int constant)
if (!constant || (old_i != i || old_totsize != totsize)) { if (!constant || (old_i != i || old_totsize != totsize)) {
statusbar(_ statusbar(_
("line %d/%d (%.0f%%), col %ld/%ld (%.0f%%), char %ld/%ld (%.0f%%)"), ("line %d/%d (%.0f%%), col %ld/%ld (%.0f%%), char %ld/%ld (%.0f%%)"),
current->lineno, totlines, linepct, xplustabs(), current->lineno, totlines, linepct, xplustabs() + 1,
xpt(current, strlen(current->data)), colpct, i, j, bytepct); xpt(current, strlen(current->data)) + 1, colpct, i, j, bytepct);
} }
old_i = i; old_i = i;