about summary refs log tree commit diff stats
path: root/src/kilo.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-06 13:10:22 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-11-06 13:10:22 -0700
commit3305ac0b90ae7f41de7f288fb0fea72f616f617c (patch)
tree0c1cae0278c7e1961e7856a2641a0841a3fe0cc7 /src/kilo.c
parent396684ebf1f8bb7751d14452f1b56fe6a27eb1f1 (diff)
downloadteliva-3305ac0b90ae7f41de7f288fb0fea72f616f617c.tar.gz
start showing error messages in editor
Before we'd end up in cryptic situations where error messages would get
hidden when the program got out of ncurses mode.

Now it's a little nicer with error messages showing up at the bottom of
the editor.

But there's still a problem: there's no way to abort without fixing an
error.
Diffstat (limited to 'src/kilo.c')
-rw-r--r--src/kilo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kilo.c b/src/kilo.c
index fbcb43e..dfcf530 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -1245,10 +1245,11 @@ void initEditor(void) {
     signal(SIGWINCH, handleSigWinCh);
 }
 
-void edit(char* filename) {
+void edit(char* filename, char* message) {
     initEditor();
     editorOpen(filename);
     enableRawMode(STDIN_FILENO);
+    editorSetStatusMessage(message);
     while(!Quit) {
         editorRefreshScreen();
         editorProcessKeypress(STDIN_FILENO);