Skip to content

Commit

Permalink
Improve behaviour of auto and periodic refresh modes
Browse files Browse the repository at this point in the history
Closes jonas#389, closes jonas#441, closes jonas#794, closes jonas#888
  • Loading branch information
koutcher committed May 4, 2019
1 parent 2f02bda commit 57dce49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,11 @@ get_input(int prompt_position, struct key *key)
while (true) {
int delay = -1;

if (opt_refresh_mode == REFRESH_MODE_PERIODIC) {
if (opt_refresh_mode != REFRESH_MODE_MANUAL) {
bool refs_refreshed = false;

delay = watch_periodic(opt_refresh_interval);
if (opt_refresh_mode == REFRESH_MODE_PERIODIC)
delay = watch_periodic(opt_refresh_interval);

foreach_displayed_view (view, i) {
if (view_can_refresh(view) &&
Expand Down
6 changes: 3 additions & 3 deletions src/watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ watch_index_handler(struct watch_handler *handler, enum watch_event event, enum
return check_file_mtime(&handler->last_modified, "%s/index", repo.git_dir)
? check : WATCH_NONE;

if (!check_file_mtime(&handler->last_modified, "%s/index", repo.git_dir) ||
event == WATCH_EVENT_SWITCH_VIEW ||
!index_diff(&diff, opt_show_untracked, false))
if (event == WATCH_EVENT_SWITCH_VIEW ||
!(check_file_mtime(&handler->last_modified, "%s/index", repo.git_dir) ||
index_diff(&diff, opt_show_untracked, false)))
return WATCH_NONE;

if (check & WATCH_INDEX_STAGED) {
Expand Down

0 comments on commit 57dce49

Please sign in to comment.