fix permute_any_mods

The termwiz Modifiers type isn't the right one!
Use the input layer types instead, and then we get the correct
string formatting.

refs: https://github.com/wez/wezterm/issues/3434
This commit is contained in:
Wez Furlong 2023-04-03 08:43:03 -07:00
parent b32863cc2f
commit 45db43aa95
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
3 changed files with 5 additions and 1 deletions

1
Cargo.lock generated
View File

@ -5166,6 +5166,7 @@ dependencies = [
"terminfo",
"termwiz",
"wezterm-dynamic",
"wezterm-input-types",
]
[[package]]

View File

@ -11,6 +11,7 @@ config = { path = "../../config" }
finl_unicode = "1.2"
terminfo = "0.8"
wezterm-dynamic = { path = "../../wezterm-dynamic" }
wezterm-input-types = { path = "../../wezterm-input-types" }
luahelper = { path = "../../luahelper" }
termwiz = { path = "../../termwiz", features=["use_serde"] }
lazy_static = "1.4"

View File

@ -204,6 +204,8 @@ fn permute_mods<'lua>(
item: mlua::Table,
allow_none: bool,
) -> mlua::Result<Vec<mlua::Value<'lua>>> {
use wezterm_input_types::Modifiers;
let mut result = vec![];
for ctrl in &[Modifiers::NONE, Modifiers::CTRL] {
for shift in &[Modifiers::NONE, Modifiers::SHIFT] {
@ -219,7 +221,7 @@ fn permute_mods<'lua>(
let (k, v) = pair?;
new_item.set(k, v)?;
}
new_item.set("mods", format!("{:?}", flags))?;
new_item.set("mods", flags.to_string())?;
result.push(new_item.to_lua(lua)?);
}
}