diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-05-26 03:25:05 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-05-26 03:25:05 -0300 |
commit | 3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246 (patch) | |
tree | 8e0bef9529ea4802b06d5d95ad5c749c2662acaa /test/page.cpp | |
parent | 98280238383dc390207827d09dc92e0459229134 (diff) | |
download | jet-3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246.tar.gz jet-3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246.zip |
Add partial support for utf-8
Diffstat (limited to 'test/page.cpp')
-rw-r--r-- | test/page.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/test/page.cpp b/test/page.cpp deleted file mode 100644 index d0a4d54..0000000 --- a/test/page.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include <curses.h> - -#define PAGE_SIZE 32 -#include "../page.cpp" - -int main() { - int exit = 0; - Page page = Page(); - - initscr(); - cbreak(); - noecho(); - nonl(); - intrflush(stdscr, FALSE); - keypad(stdscr, TRUE); - - while (!exit) { - clear(); - - for (int i = 0; i < page.gap_start; i++) { - addch(page.elements[i]); - } - for (int i = page.gap_start; i < page.gap_end; i++) { - addch('.'); - } - for (int i = page.gap_end; i < PAGE_SIZE; i++) { - addch(page.elements[i]); - } - - int input = getch(); - switch (input) { - case KEY_LEFT: - page--; - break; - case KEY_RIGHT: - page++; - break; - case KEY_BACKSPACE: - page.pop(); - break; - default: - page.push(input); - } - } - - endwin(); - return 0; -} |