index 222b3698de6bcc60395ab74519b4c9048e2e5ed6..e2ae80dfb703e3f55057cf5719d58e8ae100a32b 100644 (file)
--- a/tig.c
+++ b/tig.c
};
static struct ref_list *get_ref_list(const char *id);
-static void foreach_ref(bool (*visitor)(void *data, struct ref *ref), void *data);
+static void foreach_ref(bool (*visitor)(void *data, const struct ref *ref), void *data);
static int load_refs(void);
enum format_flags {
do_scroll_view(prev, lines);
}
- if (prev && view != prev) {
- if (split) {
- /* "Blur" the previous view. */
- update_view_title(prev);
- }
+ if (prev && view != prev && split && view_is_displayed(prev)) {
+ /* "Blur" the previous view. */
+ update_view_title(prev);
}
if (view->pipe && view->lines == 0) {
struct branch {
const char *author; /* Author of the last commit. */
time_t time; /* Date of the last activity. */
- struct ref *ref; /* Name and commit ID information. */
+ const struct ref *ref; /* Name and commit ID information. */
};
static const enum sort_field branch_sort_fields[] = {
}
static bool
-branch_open_visitor(void *data, struct ref *ref)
+branch_open_visitor(void *data, const struct ref *ref)
{
struct view *view = data;
struct branch *branch;
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:
}
string_format(view->ref, text, key, file);
+ if (status)
+ string_copy(opt_file, status->new.name);
}
static bool
}
static void
-foreach_ref(bool (*visitor)(void *data, struct ref *ref), void *data)
+foreach_ref(bool (*visitor)(void *data, const struct ref *ref), void *data)
{
size_t i;