Closed pm100 closed 1 year ago
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.
One issue so far, putty (ssh client) connection to linux does not propagate all keys states, in particular it doesnt know about shift.
This sounds a problem of Putty and there seems nothing we can do.
termion on linux, ignores select shift key so select does not work
That's fine for now.
This sounds a problem of Putty and there seems nothing we can do.
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
@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 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? What is not working on your local?
I am working on another big PR
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)
@pm100https://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 commenthttps://github.com/rhysd/tui-textarea/issues/5#issuecomment-1814859687? 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 GitHubhttps://github.com/rhysd/tui-textarea/pull/45#issuecomment-1820369175, or unsubscribehttps://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