Skip to content

Commit

Permalink
Fix keybinding with +[cmd] not triggering view refreshing (#1324)
Browse files Browse the repository at this point in the history
Also report standard error output and remove "No output" notice.
  • Loading branch information
koutcher committed Apr 8, 2024
1 parent 84e6101 commit 2560393
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Bug fixes:

- Fix `stat-*` coloring file names in `tig status` instead of just
markers (regression in 2.5.9). (#1326)
- Fix keybinding with +[cmd] not triggering view refreshing. (#1324)

tig-2.5.9
---------
Expand Down
11 changes: 4 additions & 7 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,13 @@ open_external_viewer(const char *argv[], const char *dir, bool silent, bool conf
bool ok;

if (echo) {
struct io io;
char buf[SIZEOF_STR] = "";

io_run_buf(argv, buf, sizeof(buf), dir, false);
if (*buf) {
ok = io_exec(&io, IO_RD, dir, NULL, argv, IO_RD_WITH_STDERR) && io_read_buf(&io, buf, sizeof(buf), true);
if (*buf)
report("%s", buf);
return true;
} else {
report("No output");
return false;
}

} else if (silent || is_script_executing()) {
ok = io_run_bg(argv, dir);

Expand Down
5 changes: 3 additions & 2 deletions src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,9 +851,10 @@ load_view(struct view *view, struct view *prev, enum open_flags flags)
* the screen. */
werase(view->win);
/* Do not clear the position if it is the first view. */
if (view->prev && !(flags & (OPEN_RELOAD | OPEN_REFRESH)))
if (view->prev && !(flags & (OPEN_RELOAD | OPEN_REFRESH))) {
clear_position(&view->prev_pos);
report_clear();
report_clear();
}
} else if (view_is_displayed(view)) {
redraw_view(view);
report_clear();
Expand Down

0 comments on commit 2560393

Please sign in to comment.