Skip to content

Commit

Permalink
Delay check for blame -C option
Browse files Browse the repository at this point in the history
Delay checking for -C until after we've set blame arguments from the
command line, fixing the display in cases where -C is set in the tigrc
but not on the command line
  • Loading branch information
m42a committed May 27, 2017
1 parent f0b41d1 commit 9550082
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ blame_open(struct view *view, enum open_flags flags)
char path[SIZEOF_STR];
size_t i;

if (opt_blame_options) {
for (i = 0; opt_blame_options[i]; i++) {
if (prefixcmp(opt_blame_options[i], "-C"))
continue;
state->auto_filename_display = true;
}
}

blame_update_file_name_visibility(view);

if (is_initial_view(view)) {
/* Finish validating and setting up blame options */
if (!opt_file_args || opt_file_args[1])
Expand Down Expand Up @@ -124,6 +114,16 @@ blame_open(struct view *view, enum open_flags flags)
}
}

if (opt_blame_options) {
for (i = 0; opt_blame_options[i]; i++) {
if (prefixcmp(opt_blame_options[i], "-C"))
continue;
state->auto_filename_display = true;
}
}

blame_update_file_name_visibility(view);

if (!view->env->file[0])
return error("No file chosen, press %s to open tree view",
get_view_key(view, REQ_VIEW_TREE));
Expand Down

0 comments on commit 9550082

Please sign in to comment.