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

Take wrapping into account when expanding wordwise selections #17170

Merged
merged 2 commits into from
May 2, 2024

Conversation

DHowett
Copy link
Member

@DHowett DHowett commented May 1, 2024

Closes #17165

src/host/ut_host/TextBufferTests.cpp Fixed Show fixed Hide fixed
src/host/ut_host/TextBufferTests.cpp Fixed Show fixed Hide fixed
src/host/ut_host/TextBufferTests.cpp Fixed Show fixed Hide fixed

This comment has been minimized.

Comment on lines +1445 to +1449
// Prevent wrapping to the previous line if the selection begins on whitespace
if (isControlChar)
{
break;
}
Copy link
Member

@lhecker lhecker May 1, 2024

Choose a reason for hiding this comment

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

...but should we? If I print a b and it force-wraps in the middle, shouldn't I be able to select all 4 spaces with a double click?

Copy link
Member Author

Choose a reason for hiding this comment

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

Eh, I didn't want to revisit too many of the decisions from the previous code.

But also, this is what prevents us from selecting the entire text buffer when you double-click an empty space lmao

@DHowett DHowett enabled auto-merge May 1, 2024 20:13
VERIFY_IS_TRUE(_buffer->GetRowByOffset(0).WasWrapForced());
VERIFY_IS_FALSE(_buffer->GetRowByOffset(1).WasWrapForced());
// GH#780 See the comment in WriteLinesToBuffer
// VERIFY_IS_FALSE(_buffer->GetRowByOffset(2).WasWrapForced());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// VERIFY_IS_FALSE(_buffer->GetRowByOffset(2).WasWrapForced());

dead code?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, pertinent to the comment above it

@DHowett DHowett added this pull request to the merge queue May 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 2, 2024
@lhecker lhecker added this pull request to the merge queue May 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 2, 2024
@zadjii-msft zadjii-msft added this pull request to the merge queue May 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 2, 2024
@zadjii-msft zadjii-msft added this pull request to the merge queue May 2, 2024
@DHowett DHowett removed this pull request from the merge queue due to a manual request May 2, 2024
@DHowett DHowett merged commit 6cda679 into main May 2, 2024
20 checks passed
@DHowett DHowett deleted the dev/duhowett/word-warping branch May 2, 2024 16:14
DHowett added a commit that referenced this pull request May 6, 2024
Closes #17165

(cherry picked from commit 6cda679)
Service-Card-Id: 92471634
Service-Version: 1.20
Copy link

@Zionsammy Zionsammy left a comment

Choose a reason for hiding this comment

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

Good

Copy link

@Zionsammy Zionsammy left a comment

Choose a reason for hiding this comment

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

Thanks

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

Successfully merging this pull request may close these issues.

Double-click word selection picks up the RPROMPT from the previous line because word wrapping is hard
5 participants