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

Redo selection of the first item to fix shift-select of multiple items #10253

Merged
merged 1 commit into from Oct 16, 2022

Conversation

mdonatas
Copy link
Contributor

@mdonatas mdonatas commented Oct 13, 2022

Fixes

When opening FormCommit - first item in unstaged files is selected. Then when shift-clicking on 2nd and further items to select 1fst through clicked items, the selection is made not from the top but from the bottom.

Proposed changes

  • Reset internal ListView "last selected item" index by resetting Selected to true for the first selected item.

Screenshots

Before

Notice that when shift-clicking after refresh control acts as if last item in the list has focus and selection happens from it till the item being clicked on.

shift-click-before

After

shift-click-after

Test methodology

  • Manual

Test environment(s)

  • Git Extensions 33.33.33
  • Build cb8954c (Dirty)
  • Git 2.37.3.windows.1
  • Microsoft Windows NT 10.0.22000.0
  • .NET 6.0.10
  • DPI 192dpi (200% scaling)

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned mdonatas Oct 13, 2022
@mdonatas
Copy link
Contributor Author

mdonatas commented Oct 13, 2022

This single-line fix took probably two hours to find and solve 😅 (and then another hour to record the gifs 🤣)

Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thank you

Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
Have not run

This single-line fix took probably two hours to find and solve 😅 (and then another hour to record the gifs 🤣)

Changes like this can take a lot more time than that...

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@RussKie RussKie merged commit f804cd8 into gitextensions:master Oct 16, 2022
@ghost ghost added this to the vNext milestone Oct 16, 2022
RussKie pushed a commit that referenced this pull request Oct 16, 2022
@RussKie RussKie modified the milestones: vNext, 4.0.0 Oct 16, 2022
@mdonatas mdonatas deleted the fix-shift-select branch October 20, 2022 09:17
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.

None yet

5 participants