Sfoglia il codice sorgente

scroll/jump to bottom on new input

Jochen Sprickerhof 5 anni fa
parent
commit
1d70f1f7eb
2 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 0 1
      TODO
  2. 4 0
      scroll.c

+ 0 - 1
TODO

@@ -1,5 +1,4 @@
  * strlen function which is aware of unicode
- * scroll/jump to bottom on new input
  * single char based I/O to buffer I/O
  * make scroll configurable by config.h in suckless style
    - configure option for scrollup/-down hotkeys

+ 4 - 0
scroll.c

@@ -364,6 +364,10 @@ main(int argc, char *argv[])
 				scrolldown(buf, pos);
 			else if (write(mfd, &c, 1) == -1)
 				die("write:");
+			else {
+				bottom = TAILQ_FIRST(&head);
+				scrolldown(buf, pos);
+			}
 		}
 		if (pfd[1].revents & POLLIN) {
 			ssize_t n = read(mfd, &c, 1);