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-14 07:34:23 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-14 07:34:23 -0800
commit12d738d5ce5d73d2cd7b56a22cc0874ec746894e (patch)
tree019fe6776c002989f9897b94b241844cc775e363 /src/kilo.c
parentb4e393617088ddf6d26d45f4c451e0eba4b99f89 (diff)
downloadteliva-12d738d5ce5d73d2cd7b56a22cc0874ec746894e.tar.gz
dialogs are not status messages
Diffstat (limited to 'src/kilo.c')
-rw-r--r--src/kilo.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/kilo.c b/src/kilo.c
index 0304789..f3c1437 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -672,6 +672,7 @@ static void editorMenu(void) {
     }
     draw_menu_item("^g", "go");
     draw_menu_item("^f", "find");
+    attrset(A_NORMAL);
 }
 
 extern void draw_string_on_menu (const char* s);
@@ -693,9 +694,10 @@ static void editorFindMenu(void) {
     // draw_menu_item("↓", "next");
     attroff(A_REVERSE);
     mvaddstr(LINES-1, menu_column, " ↓ ");
-    menu_column += 5;  // strlen isn't sufficient
+    menu_column += 3;  // strlen isn't sufficient
     attron(A_REVERSE);
     draw_string_on_menu("next");
+    attrset(A_NORMAL);
 }
 
 static void editorGoMenu(void) {
@@ -707,6 +709,7 @@ static void editorGoMenu(void) {
     menu_column = 2;
     draw_menu_item("Esc", "cancel");
     draw_menu_item("Enter", "submit");
+    attrset(A_NORMAL);
 }
 
 static void editorRefreshScreen(void (*menu_func)(void)) {
@@ -762,8 +765,10 @@ static void editorRefreshScreen(void (*menu_func)(void)) {
 
     (*menu_func)();
 
+    attrset(A_REVERSE);
     addstr("    ");
     addstr(E.statusmsg);
+    attrset(A_NORMAL);
 
     /* Put cursor at its current position. Note that the horizontal position
      * at which the cursor is displayed may be different compared to 'E.cx'
@@ -817,8 +822,8 @@ static void editorFind() {
     int saved_coloff = E.coloff, saved_rowoff = E.rowoff;
 
     while(1) {
-        editorSetStatusMessage("Search: %s", query);
         editorRefreshScreen(editorFindMenu);
+        mvprintw(LINES-2, 0, "Find: %s", query);
 
         int c = getch();
         if (c == KEY_BACKSPACE) {
@@ -1008,8 +1013,8 @@ static void editorGo(lua_State* L) {
     qlen = strlen(query);
 
     while(1) {
-        editorSetStatusMessage("Jump to: %s", query);
         editorRefreshScreen(editorGoMenu);
+        mvprintw(LINES-2, 0, "Go to: %s", query);
 
         int c = getch();
         if (c == KEY_BACKSPACE) {