aboutsummaryrefslogtreecommitdiffstats
path: root/git-rediff.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-10-10 14:20:03 +0200
committerMattias Andrée <m@maandree.se>2026-10-10 14:20:03 +0200
commitb2cb62247abe54ff6063b92d2d74eb4ee76c197d (patch)
tree039fafb367772d4be34756d8865f4996541e42da /git-rediff.c
parentAdd support for combining --merge and --symmetric (diff)
downloadgit-rediff-1.3.1.tar.gz
git-rediff-1.3.1.tar.bz2
git-rediff-1.3.1.tar.xz
Make ^L redrawHEAD1.3.1master
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'git-rediff.c')
-rw-r--r--git-rediff.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/git-rediff.c b/git-rediff.c
index 36a5134..586daec 100644
--- a/git-rediff.c
+++ b/git-rediff.c
@@ -24,6 +24,7 @@ enum interactive_command {
INTERACTIVE_ERROR,
INTERACTIVE_REDIFF,
INTERACTIVE_EDIT,
+ INTERACTIVE_REDRAW,
INTERACTIVE_SKIP_FILE
};
@@ -642,6 +643,8 @@ again:
}
if (c != '\n')
dprintf(ttyfd_out, "\n");
+ if (c == 'L' - '@')
+ return INTERACTIVE_REDRAW;
#ifndef TEST
if (c == 'Z' - '@') {
if (tcsetattr(ttyfd, TCSANOW, &tty_settings))
@@ -941,10 +944,15 @@ rediff_file(struct text *text_out, const struct text *text_in, size_t conflict_m
hunk.nsubs = (size_t)subhunk + 1U;
if (command != INTERACTIVE_SKIP_FILE) {
hunkno++;
+ reprompt:
display_hunk(text_in, (size_t)(hunk.subs[0].head - text_in->lines), i, &hunk, conflict_marker_size);
command = get_command(hunk.nsubs, hunkno, nhunks);
if (command == INTERACTIVE_ERROR)
goto error;
+ if (command == INTERACTIVE_REDRAW) {
+ dprintf(ttyfd_out, "\033[H\033[2J");
+ goto reprompt;
+ }
}
if (command == INTERACTIVE_EDIT)
r = manual_edit(text_out, &hunk, &text_in->lines[i], conflict_marker_size);