fix numbat aliases like mib -> MiB
This commit is contained in:
parent
f1190ab15f
commit
22007fb6b7
2
README
2
README
@ -17,4 +17,4 @@ the config.toml file is created in your current working directory on the first
|
||||
run of metasearch2. alternatively, you can copy the default-config.toml in the
|
||||
repo and rename it to config.toml.
|
||||
|
||||
the default port is port 28019.
|
||||
the default port is 28019.
|
||||
|
@ -93,7 +93,8 @@ fn interpret(query: &str) -> Option<(Statement, Markup)> {
|
||||
CodeSource::Text,
|
||||
) {
|
||||
Ok(r) => r,
|
||||
Err(_) => {
|
||||
Err(err) => {
|
||||
eprintln!("numbat error: {}", err);
|
||||
return None;
|
||||
}
|
||||
};
|
||||
@ -185,10 +186,15 @@ pub static NUMBAT_CTX: Lazy<numbat::Context> = Lazy::new(|| {
|
||||
// (the lowercase alias code won't work for these because they have prefixes)
|
||||
for (alias, canonical) in &[
|
||||
("kb", "kB"),
|
||||
("kib", "KiB"),
|
||||
("mb", "MB"),
|
||||
("mib", "MiB"),
|
||||
("gb", "GB"),
|
||||
("gib", "GiB"),
|
||||
("tb", "TB"),
|
||||
("tib", "TiB"),
|
||||
("pb", "PB"),
|
||||
("pib", "PiB"),
|
||||
] {
|
||||
let _ = ctx.interpret(&format!("let {alias} = {canonical}"), CodeSource::Internal);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user