mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-03 01:50:12 +00:00
fix(unicode): add support for more unicode characters (#470)
This commit is contained in:
parent
315a9f71fa
commit
2be2ae7cde
@ -195,6 +195,9 @@ const ALL_NF_RANGES: [&std::ops::RangeInclusive<char>; 10] = [
|
||||
&NF_RANGE_POWERLINE_2,
|
||||
];
|
||||
|
||||
const VARIOUS_UNIT_WIDTH_SYMBOLS_RANGE: std::ops::RangeInclusive<char> =
|
||||
'\u{2000}'..='\u{25FF}';
|
||||
|
||||
pub struct ReplaceNonPrintableConfig {
|
||||
pub replace_tab: bool,
|
||||
pub tab_width: usize,
|
||||
@ -330,6 +333,10 @@ pub fn replace_non_printable(
|
||||
c if ALL_NF_RANGES.iter().any(|r| r.contains(&c)) => {
|
||||
output.push(c);
|
||||
}
|
||||
// Other unit width symbols
|
||||
c if VARIOUS_UNIT_WIDTH_SYMBOLS_RANGE.contains(&c) => {
|
||||
output.push(c);
|
||||
}
|
||||
// Unicode characters above 0x0700 seem unstable with ratatui
|
||||
c if c > '\u{0700}' => {
|
||||
output.push(NULL_SYMBOL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user