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

FormGoToCommit: set focus on commit textbox when no control has focus #8593

Merged
merged 1 commit into from Nov 7, 2020

Conversation

pmiossec
Copy link
Member

@pmiossec pmiossec commented Nov 4, 2020

Fixes #8591

Proposed changes

  • When opening the form, the focus is on the commit textbox and the text is selected if textbox if filled with the clipboard content.

Perhaps not the best way to fix but it works...

Test methodology

  • Manual

Test environment(s)

  • Git Extensions 33.33.33
  • Build 7a52bdf
  • Git 2.28.0.windows.1
  • Microsoft Windows NT 10.0.17134.0
  • .NET Framework 4.8.4261.0
  • DPI 192dpi (200% scaling)

@ghost ghost assigned pmiossec Nov 4, 2020
@codecov
Copy link

codecov bot commented Nov 4, 2020

Codecov Report

Merging #8593 into master will increase coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #8593      +/-   ##
==========================================
+ Coverage   55.11%   55.14%   +0.02%     
==========================================
  Files         904      904              
  Lines       65463    65464       +1     
  Branches    11853    11853              
==========================================
+ Hits        36081    36097      +16     
+ Misses      26558    26544      -14     
+ Partials     2824     2823       -1     
Flag Coverage Δ
production 42.07% <0.00%> (+0.03%) ⬆️
tests 94.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@RussKie
Copy link
Member

RussKie commented Nov 4, 2020

Sorry, how is this fixing #8591?

@pmiossec
Copy link
Member Author

pmiossec commented Nov 4, 2020

Sorry, how is this fixing #8591?

This form is a little strange but it is the focus on one of the 3 input fields that determine which ref-spec value (commit, tag or branch) that you will use to find the commit. You could see that here:

if (textboxCommitExpression.Focused)

But because there is a bad behavior when loading the form (that I didn't exactly find out which one) and so the focus is on none of the inputs. So when you click "go", it search for the commit null and so display the error message.

My change ensure that the commit field has the focus, so the hash value is set and used and so it found the commit and select it \o/

@RussKie RussKie merged commit 45ffd65 into gitextensions:master Nov 7, 2020
@ghost ghost added this to the 4.0 milestone Nov 7, 2020
@pmiossec pmiossec deleted the fix_form_go_to_commit branch November 25, 2020 09:59
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

Successfully merging this pull request may close these issues.

Can't find commit with entire hash
2 participants