mirror of
https://github.com/wezterm/wezterm.git
synced 2026-08-02 18:22:24 +08:00
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:
parent
b32863cc2f
commit
45db43aa95
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -5166,6 +5166,7 @@ dependencies = [
|
||||
"terminfo",
|
||||
"termwiz",
|
||||
"wezterm-dynamic",
|
||||
"wezterm-input-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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)?);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user