Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[git gui] Focus of files listed in "Unstaged Changes" should be possible #859

Closed
1 task done
koppor opened this issue Aug 20, 2016 · 7 comments
Closed
1 task done

Comments

@koppor
Copy link

koppor commented Aug 20, 2016

  • I was not able to find an open
    or closed issue
    matching what I'm seeing. I searched for "Unstaged"

Setup

  • Which version of Git for Windows are you using? 32-bit or 64-bit? Include the
    output of git version as well.
$ git --version
git version 2.9.3.windows.1
  • Which version of Windows are you running? 32-bit or 64-bit?

64-bit

  • What options did you set as part of the installation? Or did you choose the
    defaults?

Defaults of choco install git.

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

    No.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash and CMD inside ConEmu

  1. git init
  2. echo "line1" > f1.txt
  3. echo "line1" > f2.txt
  4. git add .
  5. git commit -m"first commit"
  6. echo "line2" >> f1.txt
  7. echo "line2" >> f2.txt
  8. git gui&
  9. Click on field "Commit Message"
  10. Click on f1.txt at "Unstaged Changes"
  11. Press cursor-down

grabbed_20160820-090629

  • What did you expect to occur after running these commands?

f2.txt is focused

  • What actually happened instead?

Nothing happens

Note: Similar expectations exist for CTRL+T. See http://stackoverflow.com/questions/3535019/git-gui-moving-keyboard-focus-to-changed-files.

@patthoyts
Copy link

The current design of the application has the focus assigned to the commit message text field so what is actually happening is your keystroke was sent to the commit box. If you add to lines into the commit message then click on the files box and use key-up and key-down you'll see the cursor moving in the commit message field.

However, permitting keyboard control of the files control seems like a useful and worthwhile enhancement. This is not really a Git for Windows issue though but there's not currently a better place to hold this. Maybe @dscho can assign it to me.

@patthoyts
Copy link

patthoyts commented Oct 2, 2016

You might like to try out pt/non-mouse-usage which is a branch to address this. Note you need to use Ctrl-Tab to get out of the commit box as Tab just inserts a tab character.

dscho pushed a commit that referenced this issue Oct 27, 2016
Keyboard focus was restricted to the commit message widget and users were
forced to use the mouse to select files in the workdir widget and only then
could use a key combination to stage the file.
It is now possible to use key navigation (Ctrl-Tab, arrow keys and Ctrl-T
or Ctrl-U) to stage and unstage files.
Suggested by @koppor in git-for-window/git issue #859

Signed-off-by: Pat Thoyts <[email protected]>
@koppor
Copy link
Author

koppor commented Oct 31, 2016

Code looks good, but I have to investigate how to build the branch on Windows...

@dscho
Copy link
Member

dscho commented Nov 3, 2016

@koppor
Copy link
Author

koppor commented Dec 8, 2016

Works with git 2.11.0.windows.1 🎉 . Thank you for implementing @patthoyts.

However, Ctrl + T does not work on multiple entries anymore. Think, I have to submit another issue... 🎱

grabbed_20161208-100941

@koppor
Copy link
Author

koppor commented Feb 16, 2017

Not yet submitted an issue, but wrote a comment at #1012 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@patthoyts @dscho @koppor and others