Code

Status view: update the file variable when a line is selected
authorJonas Fonseca <fonseca@diku.dk>
Tue, 24 Nov 2009 03:12:32 +0000 (22:12 -0500)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 24 Nov 2009 03:19:17 +0000 (22:19 -0500)
... so %(file) works as expected.

NEWS
tig.c

diff --git a/NEWS b/NEWS
index 6467e1372b5de8734bb3383180cc1d6a536f01b0..7efc4028efb5dd3d3ae2df3819c647985672928f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,14 @@
 Release notes
 =============
 
+master
+------
+
+Improvements:
+
+ - Status view: update the file variable when a line is selected so %(file) works as
+   expected.
+
 tig-0.15
 --------
 
diff --git a/tig.c b/tig.c
index 222b3698de6bcc60395ab74519b4c9048e2e5ed6..b20fb1bfa49bb4c9ac9b1bd24481b4df3dea5a8f 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -5882,10 +5882,8 @@ status_request(struct view *view, enum request request, struct line *line)
                break;
 
        case REQ_VIEW_BLAME:
-               if (status) {
-                       string_copy(opt_file, status->new.name);
+               if (status)
                        opt_ref[0] = 0;
-               }
                return request;
 
        case REQ_ENTER:
@@ -5952,6 +5950,8 @@ status_select(struct view *view, struct line *line)
        }
 
        string_format(view->ref, text, key, file);
+       if (status)
+               string_copy(opt_file, status->new.name);
 }
 
 static bool