Add term support #19
|
@ -93,7 +93,6 @@ fn make_grid_with_newlines(term: &TerminalScreen) -> String {
|
|||
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
![]() please add more context so we both know what should be implemented here without trying to read all related code please add more context so we both know what should be implemented here without trying to read all related code
![]() .chars basically brakes non-ASCII chars. It means when you try to format path like (only applies if the [.chars](https://doc.rust-lang.org/std/primitive.str.html#method.chars) basically brakes non-ASCII chars. It means when you try to format path like `C:\nová složka\můj nový soubor` (`C:\new folder\my new file` in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation
(only applies if the `term` can be a user-defined text)
![]() if
if `.chars().count()` is really what you want (see the previous review comment) then you can replace the `if`'s body with something like:
```rust
return Some(process_for_ctrl_char(s[0], has_ctrl))
```
![]() Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control Perhaps you can use methods like [is_ascii_alphabetic](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_alphabetic) or [is_ascii_lowercase](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_lowercase) or even [is_ascii_control](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_control)
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
|
||||
|
||||
|
||||
fn process_str(s: &str, has_ctrl: bool) -> Option<char> {
|
||||
println!("process_str: {s}");
|
||||
![]() please add more context so we both know what should be implemented here without trying to read all related code please add more context so we both know what should be implemented here without trying to read all related code
![]() .chars basically brakes non-ASCII chars. It means when you try to format path like (only applies if the [.chars](https://doc.rust-lang.org/std/primitive.str.html#method.chars) basically brakes non-ASCII chars. It means when you try to format path like `C:\nová složka\můj nový soubor` (`C:\new folder\my new file` in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation
(only applies if the `term` can be a user-defined text)
![]() if
if `.chars().count()` is really what you want (see the previous review comment) then you can replace the `if`'s body with something like:
```rust
return Some(process_for_ctrl_char(s[0], has_ctrl))
```
![]() Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control Perhaps you can use methods like [is_ascii_alphabetic](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_alphabetic) or [is_ascii_lowercase](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_lowercase) or even [is_ascii_control](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_control)
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
|
||||
match s {
|
||||
"Enter" => {return Some('\n');}
|
||||
"Escape" => {return Some('\x1B');}
|
||||
|
|
|||
![]() please add more context so we both know what should be implemented here without trying to read all related code please add more context so we both know what should be implemented here without trying to read all related code
![]() .chars basically brakes non-ASCII chars. It means when you try to format path like (only applies if the [.chars](https://doc.rust-lang.org/std/primitive.str.html#method.chars) basically brakes non-ASCII chars. It means when you try to format path like `C:\nová složka\můj nový soubor` (`C:\new folder\my new file` in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation
(only applies if the `term` can be a user-defined text)
![]() if
if `.chars().count()` is really what you want (see the previous review comment) then you can replace the `if`'s body with something like:
```rust
return Some(process_for_ctrl_char(s[0], has_ctrl))
```
![]() Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control Perhaps you can use methods like [is_ascii_alphabetic](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_alphabetic) or [is_ascii_lowercase](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_lowercase) or even [is_ascii_control](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_control)
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
![]() please add more context so we both know what should be implemented here without trying to read all related code please add more context so we both know what should be implemented here without trying to read all related code
![]() .chars basically brakes non-ASCII chars. It means when you try to format path like (only applies if the [.chars](https://doc.rust-lang.org/std/primitive.str.html#method.chars) basically brakes non-ASCII chars. It means when you try to format path like `C:\nová složka\můj nový soubor` (`C:\new folder\my new file` in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation
(only applies if the `term` can be a user-defined text)
![]() if
if `.chars().count()` is really what you want (see the previous review comment) then you can replace the `if`'s body with something like:
```rust
return Some(process_for_ctrl_char(s[0], has_ctrl))
```
![]() Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control Perhaps you can use methods like [is_ascii_alphabetic](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_alphabetic) or [is_ascii_lowercase](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_lowercase) or even [is_ascii_control](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_control)
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
|
please add more context so we both know what should be implemented here without trying to read all related code
.chars basically brakes non-ASCII chars. It means when you try to format path like
C:\nová složka\můj nový soubor
(C:\new folder\my new file
in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation(only applies if the
term
can be a user-defined text)if
.chars().count()
is really what you want (see the previous review comment) then you can replace theif
's body with something like:Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control