@@ -17,9 +17,9 @@ field w_back ; # our back button
17
17
field w_path ; # label showing the current file path
18
18
field w_columns ; # list of all column widgets in the viewer
19
19
field w_line ; # text column: all line numbers
20
- field w_cgrp ; # text column: abbreviated commit SHA-1s
20
+ field w_amov ; # text column: annotations + move tracking
21
21
field w_file ; # text column: actual file data
22
- field w_cmit ; # pane showing commit message
22
+ field w_cviewer ; # pane showing commit message
23
23
field status ; # text variable bound to status bar
24
24
field old_height ; # last known height of $w.file_pane
25
25
@@ -45,7 +45,7 @@ field old_bgcolor {} ; # background of current selection
45
45
field total_lines 0 ; # total length of file
46
46
field blame_lines 0 ; # number of lines computed
47
47
field have_commit ; # array commit -> 1
48
- field line_data ; # list of {commit origfile origline}
48
+ field amov_data ; # list of {commit origfile origline}
49
49
50
50
field r_commit ; # commit currently being parsed
51
51
field r_orig_line ; # original line number
@@ -133,8 +133,8 @@ constructor new {i_commit i_path} {
133
133
-font font_diff
134
134
$w_line tag conf linenumber -justify right -rmargin 5
135
135
136
- set w_cgrp $w .file_pane.out.commit_t
137
- text $w_cgrp \
136
+ set w_amov $w .file_pane.out.amove_t
137
+ text $w_amov \
138
138
-takefocus 0 \
139
139
-highlightthickness 0 \
140
140
-padx 0 -pady 0 \
@@ -144,11 +144,11 @@ constructor new {i_commit i_path} {
144
144
-height 40 \
145
145
-width 4 \
146
146
-font font_diff
147
- $w_cgrp tag conf curr_commit
148
- $w_cgrp tag conf prior_commit \
147
+ $w_amov tag conf curr_commit
148
+ $w_amov tag conf prior_commit \
149
149
-foreground blue \
150
150
-underline 1
151
- $w_cgrp tag bind prior_commit \
151
+ $w_amov tag bind prior_commit \
152
152
<Button-1> \
153
153
" [ cb _load_commit @%x,%y] ;break"
154
154
@@ -165,7 +165,7 @@ constructor new {i_commit i_path} {
165
165
-xscrollcommand [list $w .file_pane.out.sbx set] \
166
166
-font font_diff
167
167
168
- set w_columns [list $w_cgrp $w_line $w_file ]
168
+ set w_columns [list $w_amov $w_line $w_file ]
169
169
170
170
scrollbar $w .file_pane.out.sbx \
171
171
-orient h \
@@ -184,8 +184,8 @@ constructor new {i_commit i_path} {
184
184
-weight 1
185
185
grid rowconfigure $w .file_pane.out 0 -weight 1
186
186
187
- set w_cmit $w .file_pane.cm.t
188
- text $w_cmit \
187
+ set w_cviewer $w .file_pane.cm.t
188
+ text $w_cviewer \
189
189
-background white -borderwidth 0 \
190
190
-state disabled \
191
191
-wrap none \
@@ -194,23 +194,23 @@ constructor new {i_commit i_path} {
194
194
-xscrollcommand [list $w .file_pane.cm.sbx set] \
195
195
-yscrollcommand [list $w .file_pane.cm.sby set] \
196
196
-font font_diff
197
- $w_cmit tag conf header_key \
197
+ $w_cviewer tag conf header_key \
198
198
-tabs {3c} \
199
199
-background $active_color \
200
200
-font font_uibold
201
- $w_cmit tag conf header_val \
201
+ $w_cviewer tag conf header_val \
202
202
-background $active_color \
203
203
-font font_ui
204
- $w_cmit tag raise sel
204
+ $w_cviewer tag raise sel
205
205
scrollbar $w .file_pane.cm.sbx \
206
206
-orient h \
207
- -command [list $w_cmit xview]
207
+ -command [list $w_cviewer xview]
208
208
scrollbar $w .file_pane.cm.sby \
209
209
-orient v \
210
- -command [list $w_cmit yview]
210
+ -command [list $w_cviewer yview]
211
211
pack $w .file_pane.cm.sby -side right -fill y
212
212
pack $w .file_pane.cm.sbx -side bottom -fill x
213
- pack $w_cmit -expand 1 -fill both
213
+ pack $w_cviewer -expand 1 -fill both
214
214
215
215
frame $w .status \
216
216
-borderwidth 1 \
@@ -247,7 +247,7 @@ constructor new {i_commit i_path} {
247
247
"
248
248
}
249
249
250
- foreach i [concat $w_columns $w_cmit ] {
250
+ foreach i [concat $w_columns $w_cviewer ] {
251
251
bind $i <Key-Up> {catch {%W yview scroll -1 units};break }
252
252
bind $i <Key-Down> {catch {%W yview scroll 1 units};break }
253
253
bind $i <Key-Left> {catch {%W xview scroll -1 units};break }
@@ -260,7 +260,7 @@ constructor new {i_commit i_path} {
260
260
bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break }
261
261
}
262
262
263
- bind $w_cmit <Button-1> [list focus $w_cmit ]
263
+ bind $w_cviewer <Button-1> [list focus $w_cviewer ]
264
264
bind $top <Visibility> [list focus $top ]
265
265
bind $w_file <Destroy> [list delete_this $this ]
266
266
@@ -339,7 +339,7 @@ method _load {} {
339
339
# we use only 1 based lines, as that matches both with
340
340
# git-blame output and with Tk's text widget.
341
341
#
342
- set line_data [list [list ]]
342
+ set amov_data [list [list ]]
343
343
344
344
set status " Loading $commit :[ escape_path $path ] ..."
345
345
$w_path conf -text [escape_path $path ]
@@ -406,7 +406,7 @@ method _read_file {fd} {
406
406
while {[gets $fd line] >= 0} {
407
407
regsub "\r\$ " $line {} line
408
408
incr total_lines
409
- lappend line_data {}
409
+ lappend amov_data {}
410
410
411
411
if {$total_lines > 1} {
412
412
foreach i $w_columns {$i insert end " \n " }
@@ -447,7 +447,7 @@ method _read_blame {fd} {
447
447
return
448
448
}
449
449
450
- $w_cgrp conf -state normal
450
+ $w_amov conf -state normal
451
451
while {[gets $fd line] >= 0} {
452
452
if {[regexp {^([a-z0-9]{40}) (\d+) (\d+) (\d+)$} $line line \
453
453
cmit original_line final_line line_count]} {
@@ -506,29 +506,29 @@ method _read_blame {fd} {
506
506
set first_lno $lno
507
507
while {
508
508
$first_lno > 1
509
- && $cmit eq [lindex $line_data [expr {$first_lno - 1}] 0]
510
- && $file eq [lindex $line_data [expr {$first_lno - 1}] 1]
509
+ && $cmit eq [lindex $amov_data [expr {$first_lno - 1}] 0]
510
+ && $file eq [lindex $amov_data [expr {$first_lno - 1}] 1]
511
511
} {
512
512
incr first_lno -1
513
513
}
514
514
515
515
while {$n > 0} {
516
516
set lno_e " $lno .0 lineend + 1c"
517
- if {[lindex $line_data $lno ] ne {}} {
518
- set g [lindex $line_data $lno 0]
517
+ if {[lindex $amov_data $lno ] ne {}} {
518
+ set g [lindex $amov_data $lno 0]
519
519
foreach i $w_columns {
520
520
$i tag remove g$g $lno .0 $lno_e
521
521
}
522
522
}
523
- lset line_data $lno [list $cmit $file ]
523
+ lset amov_data $lno [list $cmit $file ]
524
524
525
- $w_cgrp delete $lno .0 " $lno .0 lineend"
525
+ $w_amov delete $lno .0 " $lno .0 lineend"
526
526
if {$lno == $first_lno } {
527
- $w_cgrp insert $lno .0 $commit_abbr $commit_type
527
+ $w_amov insert $lno .0 $commit_abbr $commit_type
528
528
} elseif {$lno == [expr {$first_lno + 1}]} {
529
- $w_cgrp insert $lno .0 $author_abbr
529
+ $w_amov insert $lno .0 $author_abbr
530
530
} else {
531
- $w_cgrp insert $lno .0 { |}
531
+ $w_amov insert $lno .0 { |}
532
532
}
533
533
534
534
foreach i $w_columns {
@@ -550,17 +550,17 @@ method _read_blame {fd} {
550
550
}
551
551
552
552
while {
553
- $cmit eq [lindex $line_data $lno 0]
554
- && $file eq [lindex $line_data $lno 1]
553
+ $cmit eq [lindex $amov_data $lno 0]
554
+ && $file eq [lindex $amov_data $lno 1]
555
555
} {
556
- $w_cgrp delete $lno .0 " $lno .0 lineend"
556
+ $w_amov delete $lno .0 " $lno .0 lineend"
557
557
558
558
if {$lno == $first_lno } {
559
- $w_cgrp insert $lno .0 $commit_abbr $commit_type
559
+ $w_amov insert $lno .0 $commit_abbr $commit_type
560
560
} elseif {$lno == [expr {$first_lno + 1}]} {
561
- $w_cgrp insert $lno .0 $author_abbr
561
+ $w_amov insert $lno .0 $author_abbr
562
562
} else {
563
- $w_cgrp insert $lno .0 { |}
563
+ $w_amov insert $lno .0 { |}
564
564
}
565
565
incr lno
566
566
}
@@ -569,7 +569,7 @@ method _read_blame {fd} {
569
569
set header($r_commit ,$key ) $data
570
570
}
571
571
}
572
- $w_cgrp conf -state disabled
572
+ $w_amov conf -state disabled
573
573
574
574
if {[eof $fd ]} {
575
575
close $fd
@@ -600,8 +600,8 @@ method _click {cur_w pos} {
600
600
}
601
601
602
602
method _load_commit {pos} {
603
- set lno [lindex [split [$w_cgrp index $pos ] .] 0]
604
- set dat [lindex $line_data $lno ]
603
+ set lno [lindex [split [$w_amov index $pos ] .] 0]
604
+ set dat [lindex $amov_data $lno ]
605
605
if {$dat ne {}} {
606
606
set commit [lindex $dat 0]
607
607
set path [lindex $dat 1]
@@ -618,13 +618,13 @@ method _showcommit {lno} {
618
618
}
619
619
}
620
620
621
- $w_cmit conf -state normal
622
- $w_cmit delete 0.0 end
621
+ $w_cviewer conf -state normal
622
+ $w_cviewer delete 0.0 end
623
623
624
- set dat [lindex $line_data $lno ]
624
+ set dat [lindex $amov_data $lno ]
625
625
if {$dat eq {}} {
626
626
set cmit {}
627
- $w_cmit insert end " Loading annotation..."
627
+ $w_cviewer insert end " Loading annotation..."
628
628
} else {
629
629
set cmit [lindex $dat 0]
630
630
set file [lindex $dat 1]
@@ -680,23 +680,23 @@ method _showcommit {lno} {
680
680
set header($cmit ,message) $msg
681
681
}
682
682
683
- $w_cmit insert end " commit $cmit \n " header_key
684
- $w_cmit insert end " Author:\t " header_key
685
- $w_cmit insert end " $author_name $author_email " header_val
686
- $w_cmit insert end " $author_time \n " header_val
683
+ $w_cviewer insert end " commit $cmit \n " header_key
684
+ $w_cviewer insert end " Author:\t " header_key
685
+ $w_cviewer insert end " $author_name $author_email " header_val
686
+ $w_cviewer insert end " $author_time \n " header_val
687
687
688
- $w_cmit insert end " Committer:\t " header_key
689
- $w_cmit insert end " $committer_name $committer_email " header_val
690
- $w_cmit insert end " $committer_time \n " header_val
688
+ $w_cviewer insert end " Committer:\t " header_key
689
+ $w_cviewer insert end " $committer_name $committer_email " header_val
690
+ $w_cviewer insert end " $committer_time \n " header_val
691
691
692
692
if {$file ne $path } {
693
- $w_cmit insert end " Original File:\t " header_key
694
- $w_cmit insert end " [ escape_path $file ] \n " header_val
693
+ $w_cviewer insert end " Original File:\t " header_key
694
+ $w_cviewer insert end " [ escape_path $file ] \n " header_val
695
695
}
696
696
697
- $w_cmit insert end " \n $msg "
697
+ $w_cviewer insert end " \n $msg "
698
698
}
699
- $w_cmit conf -state disabled
699
+ $w_cviewer conf -state disabled
700
700
701
701
set highlight_line $lno
702
702
set highlight_commit $cmit
@@ -709,7 +709,7 @@ method _showcommit {lno} {
709
709
method _copycommit {} {
710
710
set pos @$::cursorX ,$::cursorY
711
711
set lno [lindex [split [$::cursorW index $pos ] .] 0]
712
- set dat [lindex $line_data $lno ]
712
+ set dat [lindex $amov_data $lno ]
713
713
if {$dat ne {}} {
714
714
clipboard clear
715
715
clipboard append \
@@ -721,7 +721,7 @@ method _copycommit {} {
721
721
722
722
method _show_tooltip {cur_w pos} {
723
723
set lno [lindex [split [$cur_w index $pos ] .] 0]
724
- set dat [lindex $line_data $lno ]
724
+ set dat [lindex $amov_data $lno ]
725
725
if {$dat eq {}} {
726
726
_hide_tooltip $this
727
727
return
@@ -755,7 +755,7 @@ method _open_tooltip {cur_w} {
755
755
[expr {$pos_x - [winfo rootx $cur_w ]}] \
756
756
[expr {$pos_y - [winfo rooty $cur_w ]}]] ,]
757
757
set lno [lindex [split [$cur_w index $pos ] .] 0]
758
- set dat [lindex $line_data $lno ]
758
+ set dat [lindex $amov_data $lno ]
759
759
set cmit [lindex $dat 0]
760
760
set file [lindex $dat 1]
761
761
0 commit comments