Skip to content

Commit 6fc835a

Browse files
angavrilovspearce
authored andcommitted
git-gui: Support the encoding menu in gui blame.
Allow dynamically changing the encoding from the blame viewer as well. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Tested-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent a1c3feb commit 6fc835a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/blame.tcl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,16 @@ constructor new {i_commit i_path i_jump} {
256256
$w.ctxm add command \
257257
-label [mc "Copy Commit"] \
258258
-command [cb _copycommit]
259+
$w.ctxm add separator
260+
menu $w.ctxm.enc
261+
build_encoding_menu $w.ctxm.enc [cb _setencoding]
262+
$w.ctxm add cascade \
263+
-label [mc "Encoding"] \
264+
-menu $w.ctxm.enc
259265
$w.ctxm add command \
260266
-label [mc "Do Full Copy Detection"] \
261267
-command [cb _fullcopyblame]
268+
$w.ctxm add separator
262269
$w.ctxm add command \
263270
-label [mc "Show History Context"] \
264271
-command [cb _gitkcommit]
@@ -791,6 +798,16 @@ method _click {cur_w pos} {
791798
_showcommit $this $cur_w $lno
792799
}
793800

801+
method _setencoding {enc} {
802+
force_path_encoding $path $enc
803+
_load $this [list \
804+
$highlight_column \
805+
$highlight_line \
806+
[lindex [$w_file xview] 0] \
807+
[lindex [$w_file yview] 0] \
808+
]
809+
}
810+
794811
method _load_commit {cur_w cur_d pos} {
795812
upvar #0 $cur_d line_data
796813
set lno [lindex [split [$cur_w index $pos] .] 0]

0 commit comments

Comments
 (0)