All of lore.kernel.org
 help / color / mirror / Atom feed
From: Birger Skogeng Pedersen <birgersp@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] git-gui: Add hotkeys to change focus between ui widgets
Date: Tue, 6 Mar 2018 15:35:21 +0100	[thread overview]
Message-ID: <CAGr--=+cAbd=8NDu5M8dbeWn=uoevhJjSvN+bgfDPWjA=V0KnQ@mail.gmail.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1803051749060.20700@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>

Thanks for the feedback.

On Mon, Mar 5, 2018 at 5:55 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Do you think there is a way to focus on the last-selected path? That would
> make this feature even more convenient, I think.

Yes, good idea. I'll implement it and create a second version.

> I am not sure that this information is still there if switching back from
> another component...

I don't think so. But I can add a variable to hold the last selected
(clicked) path for both widgets.

Thanks (again),
Birger

On Mon, Mar 5, 2018 at 5:55 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi Birger,
>
> On Wed, 28 Feb 2018, Birger Skogeng Pedersen wrote:
>
>> The user cannot change focus between the list of files, the diff view
>> and the commit message widgets without using the mouse (clicking either of
>> the four widgets ).
>>
>> Hotkeys CTRL/CMD+number (1-4) now focuses the first file of either the
>> "Unstaged Changes" or "Staged Changes", the diff view or the
>> commit message dialog widgets, respectively. This enables the user to
>> select/unselect files, view the diff and create a commit in git-gui
>> using keyboard-only.
>
> I like this!
>
>> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
>> index 91c00e648..f96c0a6b8 100755
>>
>> (This is my first patch ever, any feedback is highly appreciated)
>
> I am not an expert in Tcl/Tk, but I'll do my best to comment on this
> patch.
>
>> --- a/git-gui/git-gui.sh
>> +++ b/git-gui/git-gui.sh
>> @@ -2664,6 +2664,38 @@ proc show_less_context {} {
>>       }
>>  }
>>
>> +proc select_first_path {w} {
>> +     global file_lists last_clicked selected_paths
>> +     if {[llength $file_lists($w)] > 0} {
>> +             focus $w
>> +             set last_clicked [list $w 1]
>> +             set path [lindex $file_lists($w) 0]
>> +             array unset selected_paths
>> +             set selected_paths($path) 1
>> +             show_diff $path $w
>> +     }
>> +}
>
> Do you think there is a way to focus on the last-selected path? That would
> make this feature even more convenient, I think.
>
> I am not sure that this information is still there if switching back from
> another component...
>
>> +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
>> +}
>> +
>>  ######################################################################
>>  ##
>>  ## ui construction
>> @@ -3876,6 +3908,11 @@ 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}
>> +
>>  set file_lists($ui_index) [list]
>>  set file_lists($ui_workdir) [list]
>
> Looks good!
>
> We are currently without an active Git GUI maintainer, so I hope that
> Junio (the Git maintainer) will pick this up.
>
> Ciao,
> Johannes

  reply	other threads:[~2018-03-06 14:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 13:32 git-gui, feature request: add hotkeys to focus different widgets Birger Skogeng Pedersen
2018-02-23 10:22 ` [PATCH] git-gui: Add hotkeys to change focus between ui widgets Birger Skogeng Pedersen
2018-02-23 16:42   ` Birger Skogeng Pedersen
2018-02-28 12:10 ` Birger Skogeng Pedersen
2018-03-05 16:55   ` Johannes Schindelin
2018-03-06 14:35     ` Birger Skogeng Pedersen [this message]
2018-03-06 19:28       ` Junio C Hamano
2019-08-31 12:23         ` [PATCH] git-gui: Add hotkeys to set widget focus Birger Skogeng Pedersen
2019-08-31 12:27           ` Birger Skogeng Pedersen
2019-09-01 11:32           ` Pratyush Yadav
2019-09-01 16:21             ` Junio C Hamano
2019-09-01 18:24             ` Birger Skogeng Pedersen
2019-09-01 19:01             ` Bert Wesarg
2019-09-01 19:36               ` [PATCH] " Birger Skogeng Pedersen
2019-09-02 18:19                 ` Pratyush Yadav
2019-09-02 18:35                   ` Birger Skogeng Pedersen
2019-09-02 18:53                     ` Pratyush Yadav
2019-09-02 19:05                       ` Birger Skogeng Pedersen
2019-09-02 19:42                 ` Bert Wesarg
2019-09-03 14:21                   ` Birger Skogeng Pedersen
2019-09-03 14:22                   ` Pratyush Yadav
2019-09-03 14:45                     ` [PATCH] git-gui: use path name instead of list index to track last clicked file Pratyush Yadav
2019-09-03 18:07                       ` [PATCH v4] git-gui: Add hotkeys to set widget focus Birger Skogeng Pedersen
2019-09-03 18:13                         ` Birger Skogeng Pedersen
2019-09-03 19:30                           ` Birger Skogeng Pedersen
2019-09-03 21:49                         ` Pratyush Yadav
2019-09-04 14:30                           ` [PATCH v5] " Birger Skogeng Pedersen
2019-09-04 18:59                             ` Johannes Sixt
2019-09-04 19:20                               ` Birger Skogeng Pedersen
2019-09-04 21:39                                 ` Johannes Sixt
2019-09-04 22:31                                   ` Pratyush Yadav
2019-09-04 23:38                                     ` Junio C Hamano
2019-09-05 12:33                                       ` Pratyush Yadav
2019-09-04 19:55                               ` Bert Wesarg
2019-09-04 21:45                                 ` Johannes Sixt
2019-09-10 19:12                             ` Pratyush Yadav
2019-09-11  6:49                               ` Birger Skogeng Pedersen
2019-09-11 17:48                                 ` Pratyush Yadav
2019-09-11 18:11                                   ` Johannes Sixt
2019-09-03 16:06                     ` [PATCH] [PATCH] " Bert Wesarg
2019-09-01 22:27             ` Philip Oakley
2019-09-02 12:25               ` Pratyush Yadav
2019-09-02 17:23                 ` Philip Oakley
2019-09-03 22:18                   ` Pratyush Yadav
2019-09-01 18:58           ` Bert Wesarg
2019-09-01 19:25             ` Birger Skogeng Pedersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGr--=+cAbd=8NDu5M8dbeWn=uoevhJjSvN+bgfDPWjA=V0KnQ@mail.gmail.com' \
    --to=birgersp@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.