Added hist number to prompt, Arrows working
This commit is contained in:
@ -34,6 +34,16 @@ pub fn get_history_number() -> Result<i32, std::io::Error> {
|
||||
return Ok(number);
|
||||
}
|
||||
|
||||
pub fn get_curr_history_number() -> i32 {
|
||||
//Returns CURRENT history number, AKA the one for the command we are typing
|
||||
let mynumber = match get_history_number() {
|
||||
Ok(n) => n + 1,
|
||||
Err(e) => 1,
|
||||
};
|
||||
|
||||
return mynumber;
|
||||
}
|
||||
|
||||
pub fn get_history() -> Result<String, std::io::Error> {
|
||||
let filepath = dirs::home_dir().unwrap().join("history.sqish");
|
||||
let file = File::open(filepath)?;
|
||||
|
Reference in New Issue
Block a user