Add basic editing to tui
#include "bank.h"
#include "base.h"
#include "field.h"
+#include "gbuffer.h"
#include "mark.h"
#include "sim.h"
#include <getopt.h>
@@ -384,6 +385,11 @@ int main(int argc, char** argv) {
break;
}
+ if (key >= '!' && key <= '~') {
+ gbuffer_poke(field.buffer, field.height, field.width, tui_cursor.y,
+ tui_cursor.x, (char)key);
+ }
+
// ncurses gives us the special value KEY_RESIZE if the user didn't
// actually type anything, but the terminal resized.
// bool ignored_input = ch < CHAR_MIN || ch > CHAR_MAX || ch == KEY_RESIZE;
