last tests
authorLaurent MAZET <laurent.mazet@thalesgroup.com>
Mon, 20 May 2024 08:56:38 +0000 (10:56 +0200)
committerLaurent MAZET <laurent.mazet@thalesgroup.com>
Mon, 20 May 2024 08:56:38 +0000 (10:56 +0200)
cmore.c
tui.c

diff --git a/cmore.c b/cmore.c
index 6022cfde331c2a9155faa89517bd49a182d681d7..6718d526672e3052e50a2b291075b40bb953f343 100644 (file)
--- a/cmore.c
+++ b/cmore.c
@@ -168,7 +168,7 @@ void follow (void)
 
 void about (void)
 {
-    char *message = "CMore: a curses more\n \nThis program is a pager with a text user interface.\n- To move displayed text or in menu, use arrow keys or vim keys (i, j, k, l).\n- To access menus, use Alt-f of Alt-h.\n- To quit displayed text, press Escape or 'q'.";
+    char *message = "CMore: a curses more\n \nThis program is a pager with a text user interface.\n- To move displayed text or in menu, use arrow keys or vim keys (i, j, k, l).\ni- To access menus, use Alt-f (:f) of Alt-h (:h).\n- To edit ligne use arrow keys, ^H, ^U and ^W or press Escape to swithc in vim command (i, j, k, l, x, d, w)\n- To quit displayed text, press Escape or 'q'.";
 
     int xmax, ymax;
     WINDOW *wbody = bodywin ();
@@ -406,4 +406,7 @@ int main (int argc, char *argv[])
 /* test: (sleep 1; echo :fkk; echo not_a_file; sleep 1; echo ii) | cmore.exe -c 'ip addr' -v 3 2>&1 | grep -q "can't load" */
 /* test: (sleep 1; echo :fkk; sleep 1; echo; sleep 1; echo ii) | cmore.exe -c 'ip addr' */
 
+/* test: (sleep 1; echo :fkk; sleep 1; echo -e '\ellld\edebug.c'; sleep 1; echo :fii) | cmore.exe -f tui.h */
+/* test: (sleep 1; echo :fkk; sleep 1; echo -e '\elllw\edebug\ellx\eh'; sleep 1; echo :fii) | cmore.exe -f tui.h */
+
 /* vim: set ts=4 sw=4 et: */
diff --git a/tui.c b/tui.c
index ddeffa398f2614be12bd65f506eab6a7c07740a2..795da6576ea1e4b3495d4ea552cb6f6f2be3c193 100644 (file)
--- a/tui.c
+++ b/tui.c
@@ -675,6 +675,9 @@ int weditstr(WINDOW *win, char *buf, int field)
             }
 
             switch (c) {
+            case 'd':
+                c = killchar ();
+                break;
             case 'i':
                 c = KEY_UP;
                 break;
@@ -687,6 +690,12 @@ int weditstr(WINDOW *win, char *buf, int field)
             case 'l':
                 c = KEY_RIGHT;
                 break;
+            case 'w':
+                c = wordchar ();
+                break;
+            case 'x':
+                c = erasechar ();
+                break;
             case KEY_ESC:
                 if (mode == 3) {
                     c = ERR;