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

Fixes #1963. Only remove one character on backspace when wordwrap is on #1964

Merged
merged 4 commits into from
Sep 5, 2022

Conversation

hippiehunter
Copy link
Contributor

Fixes #1963 check if word wrap is enabled before removing the character from the model. If its enabled, use the wrap manager instead.

Copy link
Collaborator

@tig tig left a comment

Choose a reason for hiding this comment

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

Excellent find and fix. Thank you.

Once you fix the source formatting I'll merge.

Terminal.Gui/Views/TextView.cs Show resolved Hide resolved
Terminal.Gui/Views/TextView.cs Show resolved Hide resolved
@tig
Copy link
Collaborator

tig commented Aug 25, 2022

@hippiehunter, per @BDisp can you please also fix the Delete key use-case as part of this PR?

Many thanks for helping with this!

@BDisp
Copy link
Collaborator

BDisp commented Aug 25, 2022

@tig this bug is much more wide than this pr is intended for. Because now all the actions on the TextView unwrap and re-wrap, if word wrap is enabled, the management of the wrapped lines, like remove, add, is not needed anymore. So, this pr will not fix all the issues. Do you want I submit a pr to the @hippiehunter's repo or should I submit a new pr?

@BDisp
Copy link
Collaborator

BDisp commented Aug 25, 2022

@tig here is my fix https://github.com/BDisp/Terminal.Gui/tree/textview-word-wrap-delete-backwards-forwards-fix. @hippiehunter can merge into his pr or if you want I can create a new pr with my branch. Thanks.

Terminal.Gui/Views/TextView.cs Show resolved Hide resolved
@hippiehunter
Copy link
Contributor Author

Is there anything else you need me to do on this PR?

@BDisp
Copy link
Collaborator

BDisp commented Aug 26, 2022

Is there anything else you need me to do on this PR?

For me, since you already merged my fix I think is all OK and I already approved. I appreciate your help for found this issue, but the fix implied more some changes. The management for remove and add runes on wrapped lines aren't need anymore and that why it was deleting twice when word wrap is enabled We must wait for @tig to merge or saying something. Thanks.

@tig tig changed the title Fixes #1963 only remove one character on backspace when wordwrap is on Fixes #1963. Only remove one character on backspace when wordwrap is on Sep 5, 2022
@tig tig merged commit bbbacf4 into gui-cs:develop Sep 5, 2022
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.

Backspace key deletes multiple characters when editing a TextView with WordWrap = true
3 participants