mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-23 19:21:26 +02:00
Added parenthesis to sum completion.
This commit is contained in:
parent
cb1dbada71
commit
f8ef60b336
@ -93,7 +93,7 @@ const COMPLETION_FUNCS: phf::Map<&'static str, &'static str> = phf::phf_map! {
|
|||||||
"floor" => "⌊⌋",
|
"floor" => "⌊⌋",
|
||||||
"ceil" => "⌈⌉",
|
"ceil" => "⌈⌉",
|
||||||
"(" => "()",
|
"(" => "()",
|
||||||
"sum" => "Σ",
|
"sum" => "Σ()",
|
||||||
};
|
};
|
||||||
|
|
||||||
impl Completer for RLHelper {
|
impl Completer for RLHelper {
|
||||||
@ -117,7 +117,10 @@ impl Completer for RLHelper {
|
|||||||
fn update(&self, line: &mut rustyline::line_buffer::LineBuffer, start: usize, elected: &str) {
|
fn update(&self, line: &mut rustyline::line_buffer::LineBuffer, start: usize, elected: &str) {
|
||||||
line.backspace(line.pos() - start);
|
line.backspace(line.pos() - start);
|
||||||
line.insert_str(line.pos(), elected);
|
line.insert_str(line.pos(), elected);
|
||||||
line.move_forward(1);
|
line.move_forward(match elected {
|
||||||
|
"Σ()" => 2,
|
||||||
|
_ => 1,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user