Fix handling of unicode characters > 255 (#411)
This commit is contained in:
parent
095731a174
commit
428519994c
@ -108,7 +108,10 @@ fn parse_key_event_record(key_event: &KeyEventRecord) -> Option<KeyEvent> {
|
|||||||
Some(KeyCode::Char(character))
|
Some(KeyCode::Char(character))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
None
|
match std::char::from_u32(character_raw as u32) {
|
||||||
|
Some(ch) => Some(KeyCode::Char(ch)),
|
||||||
|
None => None,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -133,7 +133,7 @@ impl From<Colored> for u16 {
|
|||||||
|
|
||||||
const REMOVE_BG_MASK: u16 = BG_INTENSITY | BG_RED | BG_GREEN | BG_BLUE;
|
const REMOVE_BG_MASK: u16 = BG_INTENSITY | BG_RED | BG_GREEN | BG_BLUE;
|
||||||
// remove all background values from the original color, we don't want to reset those.
|
// remove all background values from the original color, we don't want to reset those.
|
||||||
(original_color & !(REMOVE_BG_MASK))
|
original_color & !REMOVE_BG_MASK
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WinApi will be used for systems that do not support ANSI, those are windows version less then 10. RGB and 255 (AnsiBValue) colors are not supported in that case.*/
|
/* WinApi will be used for systems that do not support ANSI, those are windows version less then 10. RGB and 255 (AnsiBValue) colors are not supported in that case.*/
|
||||||
@ -165,7 +165,7 @@ impl From<Colored> for u16 {
|
|||||||
|
|
||||||
const REMOVE_FG_MASK: u16 = FG_INTENSITY | FG_RED | FG_GREEN | FG_BLUE;
|
const REMOVE_FG_MASK: u16 = FG_INTENSITY | FG_RED | FG_GREEN | FG_BLUE;
|
||||||
// remove all foreground values from the original color, we don't want to reset those.
|
// remove all foreground values from the original color, we don't want to reset those.
|
||||||
(original_color & !(REMOVE_FG_MASK))
|
original_color & !REMOVE_FG_MASK
|
||||||
}
|
}
|
||||||
/* WinApi will be used for systems that do not support ANSI, those are windows version less then 10. RGB and 255 (AnsiBValue) colors are not supported in that case.*/
|
/* WinApi will be used for systems that do not support ANSI, those are windows version less then 10. RGB and 255 (AnsiBValue) colors are not supported in that case.*/
|
||||||
Color::Rgb { .. } => 0,
|
Color::Rgb { .. } => 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user