about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2022-04-12 11:39:41 +0300
committerPaul Fertser <fercerpav@gmail.com>2022-04-12 12:17:32 +0300
commit026522534b0c70e36cb6d94b27515f7162d930a4 (patch)
tree4a0cdfa3149ce467760e67eb5e0db638fdde99da /src/ui
parentb00e74f3b825ffb38d6d36ce411441f1148ac433 (diff)
downloadprofani-tty-026522534b0c70e36cb6d94b27515f7162d930a4.tar.gz
Show Readline prompt in input window
When doing an interactive search the prompt is needed to show the
current state of the search to avoid confusion.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/inputwin.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index 4a6cae27..de4a838b 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -320,8 +320,15 @@ _inp_win_update_virtual(void)
 static void
 _inp_write(char* line, int offset)
 {
+    int x;
+    int y __attribute__((unused));
     int col = _inp_offset_to_col(line, offset);
     werase(inp_win);
+
+    waddstr(inp_win, rl_display_prompt);
+    getyx(inp_win, y, x);
+    col += x;
+
     waddstr(inp_win, line);
     wmove(inp_win, 0, col);
     _inp_win_handle_scroll();