-
Notifications
You must be signed in to change notification settings - Fork 67
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
implement select #45
implement select #45
Conversation
… ctrlc should not change history
also tested on mac and linux. crossterm / ratatui termion on linux, ignores select shift key so select does not work, but works fine otherwise (Ie I have not broken termion support) One issue so far, putty (ssh client) connection to linux does not propagate all keys states, in particular it doesnt know about shift. tested on linux and windows using termwiz, works. Not exhaustively tested |
Thank you. I'll review this today or tomorrow. And adding tests is really helpful. |
This sounds a problem of Putty and there seems nothing we can do.
That's fine for now. |
I thought about for a few mins and this is a general issue with remote tings like SSH. They transmit the resulting ascii code not the actual key combinations.
But it was good to test just to make sure something not broken (same as termion) |
i believe I have fixed all your issues. I also found a horrific set of bugs in multi byte char mode (japanese, etc). I did not realize that highlight boundaries are in bytes not chars. All fixed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This branch needs many refactorings but it is too time consuming for me to leave review comments on all places. And making the author fix all of them would be tough work. So I decided large refactoring after merging this PR.
For now, I merge this branch into main and then I'll add further changes tomorrow.
Thank you for adding this.
@rhysd I am working on another big PR (for word wrap). I am trying to merge the current head and am surprised by how much you changed the select PR. Its up to the caller to control it entirely. The automatic stop and start worked perfectly in the pure input case. Its not clear now what one should do to minimal sample for example to make select work. I was not 100% happy with how it was controlled if you did not use the input function, but taking the auto select out entirely seems a bit harsh. |
@pm100 You can take 100% control of selection by
What does 'work' here mean? What is not working on your local?
Did you see this comment? Refactorying of internal structure is necessary to avoid adhoc changes. Large PR is not acceptable since it is too hard to make it maintenable source. |
@rhysd I misunderstood how you reworked the select PR. Ignore that comment, my bad you are going to really hate the word wrap PR. But it adds huge benefit, please try it out before dismissing it. It was a lot of work ! |
I reread your select on and off logic, I prefer it. I was not 100% happy with it in the non 'input' case in my original code. Neat
…________________________________
From: Linda_pp ***@***.***>
Sent: Monday, November 20, 2023 11:25:59 PM
To: rhysd/tui-textarea ***@***.***>
Cc: pm100 ***@***.***>; Mention ***@***.***>
Subject: Re: [rhysd/tui-textarea] implement select (PR #45)
@pm100<https://github.com/pm100> You can take 100% control of selection by TextArea::start_selection and TextArea::cancel_selection. TextArea::move_cursor doesn't change the selection state.
to make select work
What does 'work' here mean?
I am working on another big PR
Did you see this comment<#5 (comment)>? Refactorying of internal structure is necessary to avoid adhoc changes. Large PR is not acceptable since it is too hard to make it maintenable source.
—
Reply to this email directly, view it on GitHub<#45 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AADXODYKLB73TF5MQJV75RDYFRJQPAVCNFSM6AAAAAA66VCBI6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRQGM3DSMJXGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
second go.
tested with all crossterm/ratatui samples. All work, including search, default select highlight color changed to be different from search highlight. Tested with hard and soft tabs, mask mode. plain ascii and complex chars
Notes.
delete_str
core asdelete_str_internal
(user visibledelete_str
now callsdelete_str_internal
) to accept flags indicating whether or not to yank and / or delete. Since delete is optional maybe there is a better name. Why no delete sometimes? ctrlc / copy needs to yank but not delete. Why no yank? If I select some text and then type it overwrites the selected text, so I need to delete, but should not yank (IMO)input
orinput_without_shortcuts
they must callshould_start_selection
. I was wondering about adding a sample for that. None of the current samples need it but I know that the project I work (gitui) on would