Re: [PATCH] git-gui: Add hotkeys to set widget focus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 1, 2019 at 1:32 PM Pratyush Yadav <me@xxxxxxxxxxxxxxxxx> wrote:
> > +
> > +proc select_first_unstaged_changes_path {} {
> > +     global ui_workdir
> > +     select_first_path $ui_workdir
> > +}
> > +
> > +proc select_first_staged_changes_path {} {
> > +     global ui_index
> > +     select_first_path $ui_index
> > +}
> > +
> > +proc focus_diff {} {
> > +     global ui_diff
> > +     focus $ui_diff
> > +}
> > +
> > +proc focus_commit_message {} {
> > +     global ui_comm
> > +     focus $ui_comm
> > +}
> > +
>
> Do you expect these functions to be re-used somewhere in the near
> future? Otherwise...
>
> >  ######################################################################
> >  ##
> >  ## ui construction
> > @@ -3877,6 +3924,14 @@ foreach i [list $ui_index $ui_workdir] {
> >  }
> >  unset i
> >
> > +bind . <$M1B-Key-1> {select_first_unstaged_changes_path}
> > +bind . <$M1B-Key-2> {select_first_staged_changes_path}
> > +bind . <$M1B-Key-3> {focus_diff}
> > +bind . <$M1B-Key-4> {focus_commit_message}
>
> ... why not just put their bodies directly in here? Something like:
>
>   bind . <$M1B-Key-1> {
>         global $ui_workdir
>         select_first_path $ui_workdir
>   }

that should also work:

bind . <$M1B-Key-1> {select_first_path $::ui_workdir}



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux