#[cfg(test)]
mod tests;
use {
crate::xkb::Keymap,
std::fmt::{Debug, Display},
};
pub struct Formatter<'a> {
pub(crate) keymap: &'a Keymap,
pub(crate) single_line: bool,
pub(crate) lookup_only: bool,
pub(crate) multiple_actions_per_level: bool,
pub(crate) rename_long_keys: bool,
}
impl Formatter<'_> {
pub fn single_line(mut self, val: bool) -> Self {
self.single_line = val;
self
}
pub fn lookup_only(mut self, val: bool) -> Self {
self.lookup_only = val;
self
}
pub fn rename_long_keys(mut self, val: bool) -> Self {
self.rename_long_keys = val;
self
}
pub fn multiple_actions_per_level(mut self, val: bool) -> Self {
self.multiple_actions_per_level = val;
self
}
}
impl Debug for Formatter<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Display::fmt(self, f)
}
}