summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Koutcher <thomas.koutcher@online.fr>2024-04-02 21:30:26 +0200
committerThomas Koutcher <thomas.koutcher@online.fr>2024-04-08 19:06:01 +0200
commit2560393673d0c249e3e81d1e4465cb41991e7867 (patch)
tree35fe5a0bb1c767ed30bd67d9f236e50e644d0fee
parent84e6101313213f3f58bc1066d0c084e5e89277ac (diff)
Fix keybinding with +[cmd] not triggering view refreshing (#1324)
Also report standard error output and remove "No output" notice.
-rw-r--r--NEWS.adoc1
-rw-r--r--src/display.c11
-rw-r--r--src/view.c5
3 files changed, 8 insertions, 9 deletions
diff --git a/NEWS.adoc b/NEWS.adoc
index d8249baa..62201bfc 100644
--- a/NEWS.adoc
+++ b/NEWS.adoc
@@ -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
---------
diff --git a/src/display.c b/src/display.c
index eb252674..53c4d744 100644
--- a/src/display.c
+++ b/src/display.c
@@ -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);
diff --git a/src/view.c b/src/view.c
index 6e419fae..3944e5f3 100644
--- a/src/view.c
+++ b/src/view.c
@@ -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();