-
Notifications
You must be signed in to change notification settings - Fork 142
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
Fix: [Fuzzy-Select] Special chars cause panic #183
Fix: [Fuzzy-Select] Special chars cause panic #183
Conversation
…rompt search term
Now that we can search using special characters, I encountered a bug where searching for a left to right char would break the order of the string, after some debugging it seems that chained ANSI escaped chars do not preserve their text order I've opened an issue in the rust repo, maybe it will be fixed someday EDIT: apparently it's an issue with the terminal implementation EDIT2: I've fixed this locally in my fork using a regex that tests whether the char is Hebrew/Arabic before highlighting it EDIT3: regex dependency is way too big and not actually needed, here's a much simpler way: //check if char is right to left aligned (arabic/hebrew unicode range)
fn is_rtl(c: char) -> bool {
('\u{0591}'..='\u{07FF}').contains(&c) // c >= '\u{0591}' && c <= '\u{07FF}'
} then just check if its rtl before highlight indices if indices.contains(&idx) && !is_rtl(c) {... |
Ideally, this should be handled by |
Sounds good. My summer is pretty packed already, so I don't have much time for coding in my free time. But if this transition is still open in fall/winter, I'm happy to contribute to this. |
I am aiming for summer but realistically I probably can't get to it before fall. |
I'm using since it allows me to check for key modifiers, which I personally needed |
Nice. Does anyone know how to write tests for crossterm? If we have proper tests for dialoguer, it would make my life so much easier. |
The crossterm source code has a lot of internal tests you can take inspiration from |
I had some leftover time and started moving to crossterm. Find my partial attempt here in case it's helpful. |
Both to fix some bugs I found and/or for helping with the rewrite, I'd like to add tests verifying the actual output on the terminal: "run this commands on the terminal/spin up this dialogue, then capture the current output", then repeat with more code. I would guess this already exists, but I can't seem to find it. |
Yeah, What I have been looking for recently is a good library to write TUI end-to-end tests. I did a bit of research and found that some python tools use Trying to find something similar in Rust ecosystem pointed me to the following:
For us to have to good testing, we need to either modify @epage I would appreciate your thoughts on this since this is related to rust-cli ecosystem as a whole. |
Historically, TUIs have been out of scope of rust-cli (there has been enough to do for normal CLIs) but I expect there is a lot we can improve about the TUI landscape. atm I don't have a TUI use case to help me dig in and see what the experience is like and speak on it, so any thoughts I have will be theoretical |
@psunkara I see; that makes a lot of sense. That's out of my depth. (I'd be happy to help adding tests once there is a testing framework.) Searching for TUI on crates.io yields the tui-rs and cursive crates (which are used for building TUI interfaces). I don't know if they allow writing TUI tests; just dropping this in case it's helpful. |
This can be closed as fixed in #245 |
This fixes #181