]> gitweb.ps.run Git - iftint/commitdiff
changes for termux, print newline after final output
authorPatrick <patrick.schoenberger@posteo.de>
Sat, 14 Oct 2023 00:53:39 +0000 (02:53 +0200)
committerPatrick <patrick.schoenberger@posteo.de>
Sat, 14 Oct 2023 00:53:39 +0000 (02:53 +0200)
.gitmodules [new file with mode: 0644]
ext/FTXUI [new submodule]
ext/termbox2 [new submodule]
main3.c

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..ff694ee
--- /dev/null
@@ -0,0 +1,6 @@
+[submodule "ext/FTXUI"]
+       path = ext/FTXUI
+       url = https://github.com/ArthurSonzogni/FTXUI
+[submodule "ext/termbox2"]
+       path = ext/termbox2
+       url = https://github.com/termbox/termbox2
diff --git a/ext/FTXUI b/ext/FTXUI
new file mode 160000 (submodule)
index 0000000..20d4be2
--- /dev/null
+++ b/ext/FTXUI
@@ -0,0 +1 @@
+Subproject commit 20d4be286bc5ad3be98fb9389552bbc1b301c23b
diff --git a/ext/termbox2 b/ext/termbox2
new file mode 160000 (submodule)
index 0000000..df4d01b
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit df4d01bf468853713906cc427c9635380a4c60bb
diff --git a/main3.c b/main3.c
index bec0d5c224f6a273a1dfbe6d08595780f6fe3edf..7929e672e1f70e0620d947ffa1bfe51d7d945cf7 100644 (file)
--- a/main3.c
+++ b/main3.c
@@ -85,7 +85,7 @@ void vt100Escape(const char * str, ...) {
 
 void vt100ClearScreen() { vt100Escape("[2J"); }
 void vt100CursorHome() { vt100Escape("[H"); }
-void vt100CursorPos(int v, int h) { vt100Escape("[%d;%dH", v, h); }
+void vt100CursorPos(int v, int h) { vt100Escape("[%d;%df", v, h); }
 void vt100SaveCursor() { vt100Escape("7"); }
 void vt100RestoreCursor() { vt100Escape("8"); }
 void vt100EnableAlternateBuffer() { vt100Escape("[?1049h"); }
@@ -404,13 +404,13 @@ void DrawInfo(InputAction actions[NK_COUNT][IN_COUNT], NodeKind nk, InputMode mo
 
     int line = 2;
 
-    vt100CursorPos(line++, h-30);
+    vt100CursorPos(line++, h-10);
     printf("%s:%s", NK_STRINGS[nk], (mode == IM_Normal ? "" : " (editing)"));
 
     for (int i = IN_L+1; i < IN_COUNT; i++) {
         InputAction action = actions[nk][i];
         if (action != IA_None) {
-            vt100CursorPos(line++, h-30);
+            vt100CursorPos(line++, h-10);
             printf("%s %s", IN_STRINGS[i], IA_STRINGS[action]);
         }
     }
@@ -585,6 +585,7 @@ int main() {
     vt100ShowCursor();
 
     NodeDraw(n);
+    printf("\n");
 
     return 0;
 }