]> Nishi Git Mirror - libw3.git/commitdiff
better scroll
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Tue, 30 Jan 2024 03:34:30 +0000 (03:34 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Tue, 30 Jan 2024 03:34:30 +0000 (03:34 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@140 d27a3e52-49c5-7645-884c-6793ebffc270

Example/w3b/w3b.c

index 2f3c4ba597db0d0a46e1b8347c3efd0f5c63260e..e74c581199576c918e98f6e48907bb401f93d48f 100644 (file)
@@ -204,7 +204,7 @@ void html_handler(char* tagname, char* attr) {
        fflush(stdout);
        if(x >= termw) {
                if(nl >= start) {
-                       nl++;
+                       nl += x / termw;
                        x = x % termw;
                }
        }
@@ -263,7 +263,7 @@ void text_handler(char* data) {
                x += strlen(text);
                if(x >= termw) {
                        if(nl >= start) {
-                               nl++;
+                               nl += x / termw;
                                x = x % termw;
                        }
                }