summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/diff.tcl18
-rw-r--r--lib/mergetool.tcl8
2 files changed, 14 insertions, 12 deletions
diff --git a/lib/diff.tcl b/lib/diff.tcl
index 14a479ffdf..153437b18e 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -24,10 +24,16 @@ proc reshow_diff {} {
set p $current_diff_path
if {$p eq {}} {
# No diff is being shown.
- } elseif {$current_diff_side eq {}
- || [catch {set s $file_states($p)}]
- || [lsearch -sorted -exact $file_lists($current_diff_side) $p] == -1} {
+ } elseif {$current_diff_side eq {}} {
clear_diff
+ } elseif {[catch {set s $file_states($p)}]
+ || [lsearch -sorted -exact $file_lists($current_diff_side) $p] == -1} {
+
+ if {[find_next_diff $current_diff_side $p {} {[^O]}]} {
+ next_diff
+ } else {
+ clear_diff
+ }
} else {
set save_pos [lindex [$ui_diff yview] 0]
show_diff $p $current_diff_side {} $save_pos
@@ -71,6 +77,7 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} {
}
if {$lno >= 1} {
$w tag add in_diff $lno.0 [expr {$lno + 1}].0
+ $w see $lno.0
}
set s $file_states($path)
@@ -366,10 +373,9 @@ proc apply_hunk {x y} {
}
unlock_index
display_file $current_diff_path $mi
+ # This should trigger shift to the next changed file
if {$o eq {_}} {
- clear_diff
- } else {
- set current_diff_path $current_diff_path
+ reshow_diff
}
}
diff --git a/lib/mergetool.tcl b/lib/mergetool.tcl
index 5f3da1f623..79c58bc7bc 100644
--- a/lib/mergetool.tcl
+++ b/lib/mergetool.tcl
@@ -24,13 +24,9 @@ This operation can be undone only by restarting the merge." \
}
proc merge_add_resolution {path} {
- global current_diff_path
+ global current_diff_path ui_workdir
- if {$path eq $current_diff_path} {
- set after {reshow_diff;}
- } else {
- set after {}
- }
+ set after [next_diff_after_action $ui_workdir $path {} {^_?U}]
update_index \
[mc "Adding resolution for %s" [short_path $path]] \