mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-30 01:44:58 +03:00
WIP: make search better (needs more work!)
This commit is contained in:
parent
7c00996b78
commit
82691b3157
@ -405,7 +405,7 @@ pub async fn terminal(
|
|||||||
cursor::MoveTo(0, win_rows),
|
cursor::MoveTo(0, win_rows),
|
||||||
terminal::Clear(ClearType::CurrentLine),
|
terminal::Clear(ClearType::CurrentLine),
|
||||||
Print(utils::truncate_in_place(
|
Print(utils::truncate_in_place(
|
||||||
&format!("{} * {}", our.name, ¤t_line[prompt_len..]),
|
&format!("{} * {}: no results", our.name, ¤t_line[prompt_len..]),
|
||||||
prompt_len,
|
prompt_len,
|
||||||
win_cols,
|
win_cols,
|
||||||
(line_col, cursor_col))),
|
(line_col, cursor_col))),
|
||||||
@ -465,8 +465,20 @@ pub async fn terminal(
|
|||||||
(line_col, cursor_col))),
|
(line_col, cursor_col))),
|
||||||
cursor::MoveTo(cursor_col, win_rows),
|
cursor::MoveTo(cursor_col, win_rows),
|
||||||
)?;
|
)?;
|
||||||
continue;
|
} else {
|
||||||
|
execute!(
|
||||||
|
stdout,
|
||||||
|
cursor::MoveTo(0, win_rows),
|
||||||
|
terminal::Clear(ClearType::CurrentLine),
|
||||||
|
Print(utils::truncate_in_place(
|
||||||
|
&format!("{} * {}: no results", our.name, ¤t_line[prompt_len..]),
|
||||||
|
prompt_len,
|
||||||
|
win_cols,
|
||||||
|
(line_col, cursor_col))),
|
||||||
|
cursor::MoveTo(cursor_col, win_rows),
|
||||||
|
)?;
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
execute!(
|
execute!(
|
||||||
stdout,
|
stdout,
|
||||||
@ -503,8 +515,20 @@ pub async fn terminal(
|
|||||||
(line_col, cursor_col))),
|
(line_col, cursor_col))),
|
||||||
cursor::MoveTo(cursor_col, win_rows),
|
cursor::MoveTo(cursor_col, win_rows),
|
||||||
)?;
|
)?;
|
||||||
continue;
|
} else {
|
||||||
|
execute!(
|
||||||
|
stdout,
|
||||||
|
cursor::MoveTo(0, win_rows),
|
||||||
|
terminal::Clear(ClearType::CurrentLine),
|
||||||
|
Print(utils::truncate_in_place(
|
||||||
|
&format!("{} * {}: no results", our.name, ¤t_line[prompt_len..]),
|
||||||
|
prompt_len,
|
||||||
|
win_cols,
|
||||||
|
(line_col, cursor_col))),
|
||||||
|
cursor::MoveTo(cursor_col, win_rows),
|
||||||
|
)?;
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
execute!(
|
execute!(
|
||||||
stdout,
|
stdout,
|
||||||
@ -579,7 +603,7 @@ pub async fn terminal(
|
|||||||
command_history.search(
|
command_history.search(
|
||||||
¤t_line[prompt_len..],
|
¤t_line[prompt_len..],
|
||||||
search_depth
|
search_depth
|
||||||
).unwrap_or(¤t_line[prompt_len..]).to_string()
|
).unwrap_or_default().to_string()
|
||||||
};
|
};
|
||||||
let next = format!("{} > ", our.name);
|
let next = format!("{} > ", our.name);
|
||||||
execute!(
|
execute!(
|
||||||
|
Loading…
Reference in New Issue
Block a user