source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e"
dependencies = [
- "nix 0.26.2",
+ "nix",
"windows-sys 0.48.0",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
+[[package]]
+name = "home"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"
+dependencies = [
+ "windows-sys 0.48.0",
+]
+
[[package]]
name = "hostname"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
-[[package]]
-name = "memoffset"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
-dependencies = [
- "autocfg",
-]
-
[[package]]
name = "mime"
version = "0.3.17"
"smallvec",
]
-[[package]]
-name = "nix"
-version = "0.23.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c"
-dependencies = [
- "bitflags 1.3.2",
- "cc",
- "cfg-if",
- "libc",
- "memoffset",
-]
-
[[package]]
name = "nix"
version = "0.26.2"
[[package]]
name = "rustyline"
-version = "9.1.2"
+version = "12.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db7826789c0e25614b03e5a54a0717a86f9ff6e6e5247f92b369472869320039"
+checksum = "994eca4bca05c87e86e15d90fc7a91d1be64b4482b38cb2d27474568fe7c9db9"
dependencies = [
- "bitflags 1.3.2",
+ "bitflags 2.3.3",
"cfg-if",
"clipboard-win",
- "dirs-next",
"fd-lock",
+ "home",
"libc",
"log",
"memchr",
- "nix 0.23.2",
+ "nix",
"radix_trie",
"scopeguard",
- "smallvec",
"unicode-segmentation",
"unicode-width",
"utf8parse",
phf = { version = "0.9", features = ["macros"] }
ref_thread_local = "0.0.0"
rug = { version = "1.15.0", optional = true }
-rustyline = "9.0.0"
+rustyline = "12.0.0"
ring = "0.16.13"
ripemd160 = "0.8.0"
sha3 = "0.8.2"
let print_struct = |printer: &mut Self, name: Atom, arity: usize| {
if name == atom!("[]") && arity == 0 {
- if !printer.at_cdr("") {
- append_str!(printer, "[]");
- }
+ append_str!(printer, "[]");
} else if arity > 0 {
if let Some(spec) = fetch_op_spec(name, arity, printer.op_dir) {
printer.handle_op_as_struct(
use indexmap::IndexSet;
use rustyline::error::ReadlineError;
+use rustyline::history::DefaultHistory;
use rustyline::{Config, Editor};
use std::collections::VecDeque;
#[derive(Debug)]
pub struct ReadlineStream {
- rl: Editor<Helper>,
+ rl: Editor<Helper, DefaultHistory>,
pending_input: CharReader<Cursor<String>>,
add_history: bool,
}
impl ReadlineStream {
#[inline]
pub fn new(pending_input: &str, add_history: bool) -> Self {
- let config = Config::builder().check_cursor_position(true).build();
+ let config = Config::builder()
+ .check_cursor_position(true)
+ .build();
+
let helper = Helper::new();
- let mut rl = Editor::with_config(config);
+ let mut rl = Editor::with_config(config).unwrap();
rl.set_helper(Some(helper));
if let Some(mut path) = dirs_next::home_dir() {
}
}
- // rl.bind_sequence(KeyEvent::from('\t'), Cmd::Insert(1, "\t".to_string()));
-
ReadlineStream {
rl,
pending_input: CharReader::new(Cursor::new(pending_input.to_owned())),
unsafe {
if PROMPT {
- self.rl.history_mut().add(self.pending_input.get_ref().get_ref());
+ self.rl.add_history_entry(self.pending_input.get_ref().get_ref()).unwrap();
self.save_history();
PROMPT = false;
}