#![doc = include_str!("README.md")]
#![doc(alias = "interactivity")]
use crate::prelude::build_plugin::*;
#[derive(Debug)]
pub(crate) struct PluginDefinition;
impl Plugin for PluginDefinition {
fn can_handle(&self, context: ContextCanHandle) -> bool {
matches!(
context.modifier,
Modifier::Builtin {
value: "" | "x" | "y" | "none",
..
}
)
}
fn handle(&self, context: &mut ContextHandle) {
match context.modifier {
Modifier::Builtin { value, .. } => match *value {
"" => context.buffer.line("resize: both;"),
"none" => context.buffer.line("resize: none;"),
"x" => context.buffer.line("resize: horizontal;"),
"y" => context.buffer.line("resize: vertical;"),
_ => unreachable!(),
},
Modifier::Arbitrary { .. } => unreachable!(),
}
}
}