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

OCGV - Fixes OutputMode Single #107

Merged
merged 25 commits into from
Sep 27, 2020
Merged

Conversation

tig
Copy link
Collaborator

@tig tig commented Sep 27, 2020

This PR fixes #23 and #79 for ocgv. It is dependent on PR #106.

Previously -OutputMode Single worked exactly like -OutputMode Multiple which was a bug. With this PR all three modes (None, Single, and Multiple) work correctly:

  • None - No marking of items is possible. ENTER does nothing. ESC cancels.

  • Single - No marking of multiple items is possible. Single selection 'mark UI' is shown. SPACE selects a single item. NTER selects the selected item and it is returned. ESC cancels.

  • Multiple - Marking of multiple items is possible with Multiple selection 'mark UI' using SPACE. ENTER returns selected items. ESC cancels.

  • Closes: Out-ConsoleGridView -OutputMode Single - cannot select anything #79

@tig tig marked this pull request as ready for review September 27, 2020 15:52
@TylerLeonhardt
Copy link
Member

I see a couple changes from the other PR. Can you rebase?

@@ -27,7 +27,7 @@ public HashSet<int> Start(ApplicationData applicationData)
_applicationData = applicationData;
_gridViewDetails = new GridViewDetails
{
// If we have an OutputMode, then we want to make them selectable. If we make them selectable,
// If OutputMode is Multiple, then we make items selectable. If we make them selectable,
// they have a 8 character addition of a checkbox (" [ ]") that we have to factor in.
ListViewOffset = _applicationData.OutputMode != OutputModeOption.None ? 8 : 4
Copy link
Member

Choose a reason for hiding this comment

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

don't you need to change this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The spacing is correct for both Single and Multiple modes now (we are now using Terminal.Gui's AllowsMultipleSelection feature.

the comment is not quite right. I'll fix it.

@TylerLeonhardt
Copy link
Member

I don't know why anyone would use None at this point... but I'm fine keeping it in for consistancy

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

LGTM

@TylerLeonhardt TylerLeonhardt merged commit 18be2ce into PowerShell:master Sep 27, 2020
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.

Out-ConsoleGridView -OutputMode Single - cannot select anything -OutPutMode not honored
2 participants