Replace screen-update action with noop action named "none"
authorJonas Fonseca <fonseca@diku.dk>
Fri, 8 Sep 2006 17:04:55 +0000 (19:04 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Fri, 8 Sep 2006 17:07:24 +0000 (19:07 +0200)
Promote it as a way to unbind built-in default key bindings.

tig.c
tigrc.5.txt

diff --git a/tig.c b/tig.c
index 7b8fc7d..089a567 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -283,8 +283,8 @@ sq_quote(char buf[SIZEOF_STR], size_t bufsize, const char *src)
        REQ_(SCROLL_PAGE_DOWN,  "Scroll one page down"), \
        \
        REQ_GROUP("Misc") \
+       REQ_(NONE,              "Do nothing"), \
        REQ_(PROMPT,            "Bring up the prompt"), \
-       REQ_(SCREEN_UPDATE,     "Update the screen"), \
        REQ_(SCREEN_REDRAW,     "Redraw the screen"), \
        REQ_(SCREEN_RESIZE,     "Resize the screen"), \
        REQ_(SHOW_VERSION,      "Show version information"), \
@@ -691,9 +691,9 @@ static struct keybinding default_keybindings[] = {
        { ':',          REQ_PROMPT },
 
        /* wgetch() with nodelay() enabled returns ERR when there's no input. */
-       { ERR,          REQ_SCREEN_UPDATE },
+       { ERR,          REQ_NONE },
 
-       /* Use the ncurses SIGWINCH handler. */
+       /* Using the ncurses SIGWINCH handler. */
        { KEY_RESIZE,   REQ_SCREEN_RESIZE },
 };
 
@@ -1956,7 +1956,7 @@ view_driver(struct view *view, enum request request)
                redraw_display();
                break;
 
-       case REQ_SCREEN_UPDATE:
+       case REQ_NONE:
                doupdate();
                return TRUE;
 
@@ -3016,7 +3016,7 @@ main(int argc, char *argv[])
                                break;
                        }
 
-                       request = REQ_SCREEN_UPDATE;
+                       request = REQ_NONE;
                        break;
                }
                case REQ_SCREEN_RESIZE:
index 3b4b7a2..354d46f 100644 (file)
@@ -110,6 +110,8 @@ Examples:
        bind diff a previous
        bind diff d next
        bind diff b move-first-line
+       # 'unbind' the default quit key binding
+       bind main Q none
 --------------------------------------------------------------------------
 
 Keys are mapped by first searching the keybindings for the current view, then
@@ -205,8 +207,8 @@ ifdef::backend-xhtml11[]
 endif::backend-xhtml11[]
 Misc:
 ------------------------------------------------------------------------------
+none                   Do nothing
 prompt                 Bring up the prompt
-screen-update          Update the screen
 screen-redraw          Redraw the screen
 screen-resize          Resize the screen
 show-version           Show version information