aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorJonas Maier <>2026-03-10 13:13:49 +0100
committerJonas Maier <>2026-03-10 13:13:49 +0100
commit7728b844958bb7882ddf384b40e5711d7a9316ad (patch)
treefd8ecf5981da5cb317a2328265fad88a24b80093 /src/main.rs
parent961314b443849840e15d079ebd5724383489fd05 (diff)
downloadpish-7728b844958bb7882ddf384b40e5711d7a9316ad.tar.gz
completion if there is variables in the to-be-completed string
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 1d8806a..17c4ba0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -32,6 +32,7 @@ use raw::*;
use crate::cursor::{Direction, move_cursor};
use crate::history::HistoryEntry;
use crate::parse::{Ast, PreExpansion};
+use crate::run::Executor;
macro_rules! print {
($($x:tt)*) => {{
@@ -348,7 +349,9 @@ fn event_loop() {
b'\t' => {
let cmd = se.line.into_bytes();
- let comp = parse::completion_context(&cmd);
+ drop(se);
+ let comp = parse::completion_context(&cmd, &mut Executor::new_for_completion(session.clone()));
+ let mut se = session.lock().unwrap();
match comp.kind {
parse::CompletionKind::Command => todo!(),
parse::CompletionKind::Argument => {
@@ -376,10 +379,7 @@ fn event_loop() {
stdout.lock().flush().unwrap();
}
parse::CompletionKind::None => {
- for _ in 0..4 {
- se.line.add(b' ');
- print!(" ")
- }
+ se.type_bytes(b" ");
}
}
}