show search pattern
authorLaurent Mazet <mazet@softndesign.org>
Tue, 11 Mar 2025 13:49:41 +0000 (14:49 +0100)
committerLaurent Mazet <mazet@softndesign.org>
Tue, 11 Mar 2025 13:49:41 +0000 (14:49 +0100)
display.c
fm.c

index f7041bea5ab9fb6acc30657e9e1a65df08b0fa1c..74a699c49ed18040bce6f4834c8255f403ffd53b 100644 (file)
--- a/display.c
+++ b/display.c
@@ -340,8 +340,13 @@ void displaywindow (window_t *win, list_t *list, int page, int *index_x, int *in
         *index_f = maxpos;
     }
 
-    set_color (win->active ? black : white);
+    set_color (win->active ? (search ? ired : black) : white);
     _dobound (win->xsize, win->ysize, win->xoffset, win->yoffset);
+    if (search) {
+        mvaddstr (win->yoffset + win->ysize, win->xoffset, "Search [");
+        mvaddstr (win->yoffset + win->ysize, win->xoffset + 8, search);
+        mvaddch (win->yoffset + win->ysize, win->xoffset + 8 + strlen (search), ']');
+    }
     if (page > 0) {
         mvaddch (win->yoffset, win->xoffset - 1, ACS_UARROW);
         mvaddch (win->yoffset, win->xsize + win->xoffset, ACS_UARROW);
diff --git a/fm.c b/fm.c
index 9fd6cba7eb26b066b0db1c5671a365058723292b..d39fc9f080c1faa1d0c4792799b392157443c52a 100644 (file)
--- a/fm.c
+++ b/fm.c
@@ -363,6 +363,8 @@ int main (int argc, char *argv[])
         case '/':
         case 'f':
             mode = 1;
+            search[panel] = (char *) calloc (1, 1);
+            CHECKALLOC (search);
             break;
         case 'o':
             index_f[panel]++;