We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2416ad7 + 0375154 commit 5e1f235Copy full SHA for 5e1f235
lib/diff.tcl
@@ -650,7 +650,13 @@ proc apply_or_revert_range_or_line {x y revert} {
650
}
651
652
set first_l [$ui_diff index "$first linestart"]
653
- set last_l [$ui_diff index "$last lineend"]
+ # don't include the next line if $last points to the start of a line
654
+ # ie. <lno>.0
655
+ if {[lindex [split $last .] 1] == 0} {
656
+ set last_l [$ui_diff index "$last -1 line lineend"]
657
+ } else {
658
+ set last_l [$ui_diff index "$last lineend"]
659
+ }
660
661
if {$current_diff_path eq {} || $current_diff_header eq {}} return
662
if {![lock_index apply_hunk]} return
0 commit comments