X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-gui%2Flib%2Fblame.tcl;h=1f3b08f9efff873631d73e128ee97c1b9dad1822;hb=8b75d31c945c9361331db8cd554f25a8ea6abc4a;hp=765d08c004b68254713e2524b53d6df0bdc0c007;hpb=4deca329f5da1552c8d087975dd5107519cabef7;p=git.git diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl index 765d08c00..1f3b08f9e 100644 --- a/git-gui/lib/blame.tcl +++ b/git-gui/lib/blame.tcl @@ -321,7 +321,7 @@ constructor new {i_commit i_path i_jump} { tk_popup $w.ctxm %X %Y " bind $i "[list focus $w_cviewer];break" - bind $i "[list focus $w_cviewer];break" + bind $i "[cb _focus_search $w_cviewer];break" } foreach i [concat $w_columns $w_cviewer] { @@ -337,10 +337,10 @@ constructor new {i_commit i_path i_jump} { bind $i {catch {%W yview scroll 1 pages};break} } - bind $w_cviewer "[list focus $w_file];break" + bind $w_cviewer "[cb _focus_search $w_file];break" bind $w_cviewer "[list focus $w_file];break" - bind $w_cviewer [list focus $w_cviewer] - bind $w_file [list focus $w_file] + bind $w_cviewer [list focus $w_cviewer] + bind $w_file [cb _focus_search $w_file] bind $top [list searchbar::show $finder] bind $top [list searchbar::hide $finder] bind $top [list searchbar::find_next $finder] @@ -382,6 +382,14 @@ constructor new {i_commit i_path i_jump} { _load $this $i_jump } +method _focus_search {win} { + if {[searchbar::visible $finder]} { + focus [searchbar::editor $finder] + } else { + focus $win + } +} + method _handle_destroy {win} { if {$win eq $w} { _kill $this @@ -551,7 +559,7 @@ method _read_file {fd jump} { } ifdeleted { catch {close $fd} } method _exec_blame {cur_w cur_d options cur_s} { - lappend options --incremental + lappend options --incremental --encoding=utf-8 if {$commit eq {}} { lappend options --contents $path } else { @@ -932,9 +940,8 @@ method _showcommit {cur_w lno} { catch { set fd [git_read cat-file commit $cmit] fconfigure $fd -encoding binary -translation lf - if {[catch {set enc $repo_config(i18n.commitencoding)}]} { - set enc utf-8 - } + # By default commits are assumed to be in utf-8 + set enc utf-8 while {[gets $fd line] > 0} { if {[string match {encoding *} $line]} { set enc [string tolower [string range $line 9 end]]