refactor: remove dep on key mod from common

Removing this dependency allows extracting the `fish_reserved_codepoint`
function, and other code depending on it in subsequent commits.

Part of #12625
This commit is contained in:
Daniel Rainer
2026-04-10 19:21:50 +02:00
committed by Johannes Altmanninger
parent faf331fdad
commit 3d364478ee

View File

@@ -6,7 +6,6 @@
};
use crate::global_safety::AtomicRef;
use crate::global_safety::RelaxedAtomicBool;
use crate::key;
use crate::parse_util::escape_string_with_quote;
use crate::prelude::*;
use crate::terminal::Outputter;
@@ -17,7 +16,8 @@
use fish_feature_flags::{FeatureFlag, feature_test};
use fish_wcstringutil::wcs2bytes;
use fish_widestring::{
ENCODE_DIRECT_END, decode_byte_from_char, encode_byte_to_char, subslice_position,
ENCODE_DIRECT_END, SPECIAL_KEY_ENCODE_BASE, decode_byte_from_char, encode_byte_to_char,
subslice_position,
};
use nix::sys::termios::Termios;
use std::env;
@@ -1236,7 +1236,7 @@ pub fn is_windows_subsystem_for_linux(v: WSL) -> bool {
// TODO: Actually implement the replacement as documented above.
pub fn fish_reserved_codepoint(c: char) -> bool {
(c >= RESERVED_CHAR_BASE && c < RESERVED_CHAR_END)
|| (c >= key::Backspace && c < ENCODE_DIRECT_END)
|| (c >= SPECIAL_KEY_ENCODE_BASE && c < ENCODE_DIRECT_END)
}
/// Test if the given char is valid in a variable name.