]> git.wh0rd.org Git - nano.git/commitdiff
Make do_cursorpos() use xpt() instead of just current_x which is inaccurate
authorChris Allegretta <chrisa@asty.org>
Fri, 1 Mar 2002 02:25:35 +0000 (02:25 +0000)
committerChris Allegretta <chrisa@asty.org>
Fri, 1 Mar 2002 02:25:35 +0000 (02:25 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1091 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

winio.c

diff --git a/winio.c b/winio.c
index 08ee9910117024c3cfdf38fe7ff261f13156ce3f..1ad69bde33038b7af4d1d9f7a9d92cb4780556ee 100644 (file)
--- a/winio.c
+++ b/winio.c
@@ -1602,7 +1602,7 @@ int do_cursorpos(int constant)
     if (strlen(current->data) == 0)
        colpct = 0;
     else
-       colpct = 100 * current_x / strlen(current->data);
+       colpct = 100 * xplustabs() / xpt(current, strlen(current->data));
 
     for (fileptr = fileage; fileptr != current && fileptr != NULL;
         fileptr = fileptr->next)
@@ -1632,8 +1632,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, current_x
-                 strlen(current->data), colpct, i, j, bytepct);
+                 current->lineno, totlines, linepct, xplustabs()
+                 xpt(current, strlen(current->data)), colpct, i, j, bytepct);
     }
 
     old_i = i;