From 3d364478eecf4541099114f5ef17867387a1b08b Mon Sep 17 00:00:00 2001 From: Daniel Rainer Date: Fri, 10 Apr 2026 19:21:50 +0200 Subject: [PATCH] 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 --- src/common.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common.rs b/src/common.rs index 8eb4bb5cd..48b53d869 100644 --- a/src/common.rs +++ b/src/common.rs @@ -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.