Skip to content

Commit 3baee1f

Browse files
committed
git-gui: Focus insertion point at end of strings in repository chooser
When selecting a local working directory for a new repository or a location to clone an existing repository into we now set the insert point at the end of the selected path, allowing the user to type in any additional parts of the path if they so desire. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent df4ec4c commit 3baee1f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/choose_repository.tcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ field w_quit ; # Quit button
1111
field o_cons ; # Console object (if active)
1212
field w_types ; # List of type buttons in clone
1313
field w_recentlist ; # Listbox containing recent repositories
14+
field w_localpath ; # Entry widget bound to local_path
1415

1516
field done 0 ; # Finished picking the repository?
1617
field local_path {} ; # Where this repository is locally
@@ -385,6 +386,7 @@ method _do_new {} {
385386
button $w_body.where.b \
386387
-text [mc "Browse"] \
387388
-command [cb _new_local_path]
389+
set w_localpath $w_body.where.t
388390

389391
pack $w_body.where.b -side right
390392
pack $w_body.where.l -side left
@@ -416,6 +418,7 @@ method _new_local_path {} {
416418
return
417419
}
418420
set local_path $p
421+
$w_localpath icursor end
419422
}
420423

421424
method _do_new2 {} {
@@ -481,6 +484,7 @@ method _do_clone {} {
481484
-text [mc "Browse"] \
482485
-command [cb _new_local_path]
483486
grid $args.where_l $args.where_t $args.where_b -sticky ew
487+
set w_localpath $args.where_t
484488

485489
label $args.type_l -text [mc "Clone Type:"]
486490
frame $args.type_f

0 commit comments

Comments
 (0)