From acaef3b3645a81aa7d617b3ffe42715f75be6d36 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Tue, 25 Sep 2007 12:15:22 +0200 Subject: [PATCH] Add support for refreshing/reloading the status view ... and also refresh it after edits to capture any changes in the working tree. --- tig.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tig.c b/tig.c index 620f14b..7c4afae 100644 --- a/tig.c +++ b/tig.c @@ -318,6 +318,7 @@ sq_quote(char buf[SIZEOF_STR], size_t bufsize, const char *src) REQ_(NEXT, "Move to next"), \ REQ_(PREVIOUS, "Move to previous"), \ REQ_(VIEW_NEXT, "Move focus to next view"), \ + REQ_(REFRESH, "Reload and refresh"), \ REQ_(VIEW_CLOSE, "Close the current view"), \ REQ_(QUIT, "Close all views and quit"), \ \ @@ -751,6 +752,7 @@ static struct keybinding default_keybindings[] = { { KEY_RETURN, REQ_ENTER }, { KEY_UP, REQ_PREVIOUS }, { KEY_DOWN, REQ_NEXT }, + { 'R', REQ_REFRESH }, /* Cursor navigation */ { 'k', REQ_MOVE_UP }, @@ -2285,6 +2287,10 @@ view_driver(struct view *view, enum request request) report(""); break; } + case REQ_REFRESH: + report("Refreshing is not yet supported for the %s view", view->name); + break; + case REQ_TOGGLE_LINENO: opt_line_number = !opt_line_number; redraw_display(); @@ -3320,12 +3326,17 @@ status_request(struct view *view, enum request request, struct line *line) return request; open_editor(status->status != '?', status->name); + open_view(view, REQ_VIEW_STATUS, OPEN_RELOAD); break; case REQ_ENTER: status_enter(view, line); break; + case REQ_REFRESH: + open_view(view, REQ_VIEW_STATUS, OPEN_RELOAD); + break; + default: return request; } -- 2.30.2