more cleanup
This commit is contained in:
@@ -115,6 +115,12 @@ impl FunctionManager {
|
||||
}),
|
||||
);
|
||||
|
||||
// Only keep valid chars
|
||||
new_string = new_string
|
||||
.chars()
|
||||
.filter(|c| crate::misc::is_valid_char(c))
|
||||
.collect::<String>();
|
||||
|
||||
// If not fully open, return here as buttons cannot yet be displayed, therefore the user is inable to mark it for deletion
|
||||
if ui.ctx().animate_bool(*te_id, re.has_focus()) == 1.0 {
|
||||
function.autocomplete.update_string(&new_string);
|
||||
|
||||
@@ -182,3 +182,7 @@ pub fn random_u64() -> Result<u64, getrandom::Error> {
|
||||
// Merge buffer into u64
|
||||
Ok(u64::from_be_bytes(buf))
|
||||
}
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/valid_chars.rs"));
|
||||
|
||||
pub fn is_valid_char(c: &char) -> bool { c.is_alphanumeric() | VALID_EXTRA_CHARS.contains(c) }
|
||||
|
||||
Reference in New Issue
Block a user