File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ constructor new {i_commit i_path i_jump} {
321
321
tk_popup $w .ctxm %X %Y
322
322
"
323
323
bind $i <Shift-Tab> " [ list focus $w_cviewer ] ;break"
324
- bind $i <Tab> " [ list focus $w_cviewer ] ;break"
324
+ bind $i <Tab> " [ cb _focus_search $w_cviewer ] ;break"
325
325
}
326
326
327
327
foreach i [concat $w_columns $w_cviewer ] {
@@ -337,10 +337,10 @@ constructor new {i_commit i_path i_jump} {
337
337
bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break }
338
338
}
339
339
340
- bind $w_cviewer <Shift-Tab> " [ list focus $w_file ] ;break"
340
+ bind $w_cviewer <Shift-Tab> " [ cb _focus_search $w_file ] ;break"
341
341
bind $w_cviewer <Tab> " [ list focus $w_file ] ;break"
342
- bind $w_cviewer <Button-1> [list focus $w_cviewer ]
343
- bind $w_file <Visibility> [list focus $w_file ]
342
+ bind $w_cviewer <Button-1> [list focus $w_cviewer ]
343
+ bind $w_file <Visibility> [cb _focus_search $w_file ]
344
344
bind $top <F7> [list searchbar::show $finder ]
345
345
bind $top <Escape> [list searchbar::hide $finder ]
346
346
bind $top <F3> [list searchbar::find_next $finder ]
@@ -382,6 +382,14 @@ constructor new {i_commit i_path i_jump} {
382
382
_load $this $i_jump
383
383
}
384
384
385
+ method _focus_search {win} {
386
+ if {[searchbar::visible $finder ]} {
387
+ focus [searchbar::editor $finder ]
388
+ } else {
389
+ focus $win
390
+ }
391
+ }
392
+
385
393
method _handle_destroy {win} {
386
394
if {$win eq $w } {
387
395
_kill $this
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ constructor new {i_w i_text args} {
19
19
20
20
frame $w
21
21
label $w .l -text [mc Find:]
22
+ entry $w .ent -textvariable ${__this} ::searchstring -background lightgreen
22
23
button $w .bn -text [mc Next] -command [cb find_next]
23
24
button $w .bp -text [mc Prev] -command [cb find_prev]
24
25
checkbutton $w .cs -text [mc Case-Sensitive] \
25
26
-variable ${__this} ::casesensitive -command [cb _incrsearch]
26
- entry $w .ent -textvariable ${__this} ::searchstring -background lightgreen
27
27
pack $w .l -side left
28
28
pack $w .cs -side right
29
29
pack $w .bp -side right
@@ -40,19 +40,27 @@ constructor new {i_w i_text args} {
40
40
}
41
41
42
42
method show {} {
43
- if {![winfo ismapped $w ]} {
43
+ if {![visible $this ]} {
44
44
grid $w
45
45
}
46
46
focus -force $w .ent
47
47
}
48
48
49
49
method hide {} {
50
- if {[winfo ismapped $w ]} {
50
+ if {[visible $this ]} {
51
51
focus $ctext
52
52
grid remove $w
53
53
}
54
54
}
55
55
56
+ method visible {} {
57
+ return [winfo ismapped $w ]
58
+ }
59
+
60
+ method editor {} {
61
+ return $w .ent
62
+ }
63
+
56
64
method _get_new_anchor {} {
57
65
# use start of selection if it is visible,
58
66
# or the bounds of the visible area
You can’t perform that action at this time.
0 commit comments