correct max_depth option (#1876)
This commit is contained in:
44
Cargo.lock
generated
44
Cargo.lock
generated
@@ -351,7 +351,7 @@ version = "3.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e"
|
checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nix 0.26.2",
|
"nix",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -758,6 +758,15 @@ version = "0.3.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
|
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]]
|
[[package]]
|
||||||
name = "hostname"
|
name = "hostname"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
@@ -1149,15 +1158,6 @@ version = "2.5.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "memoffset"
|
|
||||||
version = "0.6.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
|
|
||||||
dependencies = [
|
|
||||||
"autocfg",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mime"
|
name = "mime"
|
||||||
version = "0.3.17"
|
version = "0.3.17"
|
||||||
@@ -1258,19 +1258,6 @@ dependencies = [
|
|||||||
"smallvec",
|
"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]]
|
[[package]]
|
||||||
name = "nix"
|
name = "nix"
|
||||||
version = "0.26.2"
|
version = "0.26.2"
|
||||||
@@ -1813,22 +1800,21 @@ checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustyline"
|
name = "rustyline"
|
||||||
version = "9.1.2"
|
version = "12.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "db7826789c0e25614b03e5a54a0717a86f9ff6e6e5247f92b369472869320039"
|
checksum = "994eca4bca05c87e86e15d90fc7a91d1be64b4482b38cb2d27474568fe7c9db9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.3.3",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"clipboard-win",
|
"clipboard-win",
|
||||||
"dirs-next",
|
|
||||||
"fd-lock",
|
"fd-lock",
|
||||||
|
"home",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"memchr",
|
"memchr",
|
||||||
"nix 0.23.2",
|
"nix",
|
||||||
"radix_trie",
|
"radix_trie",
|
||||||
"scopeguard",
|
"scopeguard",
|
||||||
"smallvec",
|
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
"utf8parse",
|
"utf8parse",
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ ordered-float = "2.6.0"
|
|||||||
phf = { version = "0.9", features = ["macros"] }
|
phf = { version = "0.9", features = ["macros"] }
|
||||||
ref_thread_local = "0.0.0"
|
ref_thread_local = "0.0.0"
|
||||||
rug = { version = "1.15.0", optional = true }
|
rug = { version = "1.15.0", optional = true }
|
||||||
rustyline = "9.0.0"
|
rustyline = "12.0.0"
|
||||||
ring = "0.16.13"
|
ring = "0.16.13"
|
||||||
ripemd160 = "0.8.0"
|
ripemd160 = "0.8.0"
|
||||||
sha3 = "0.8.2"
|
sha3 = "0.8.2"
|
||||||
|
|||||||
@@ -1465,9 +1465,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
|
|||||||
|
|
||||||
let print_struct = |printer: &mut Self, name: Atom, arity: usize| {
|
let print_struct = |printer: &mut Self, name: Atom, arity: usize| {
|
||||||
if name == atom!("[]") && arity == 0 {
|
if name == atom!("[]") && arity == 0 {
|
||||||
if !printer.at_cdr("") {
|
|
||||||
append_str!(printer, "[]");
|
append_str!(printer, "[]");
|
||||||
}
|
|
||||||
} else if arity > 0 {
|
} else if arity > 0 {
|
||||||
if let Some(spec) = fetch_op_spec(name, arity, printer.op_dir) {
|
if let Some(spec) = fetch_op_spec(name, arity, printer.op_dir) {
|
||||||
printer.handle_op_as_struct(
|
printer.handle_op_as_struct(
|
||||||
|
|||||||
14
src/read.rs
14
src/read.rs
@@ -17,6 +17,7 @@ use fxhash::FxBuildHasher;
|
|||||||
|
|
||||||
use indexmap::IndexSet;
|
use indexmap::IndexSet;
|
||||||
use rustyline::error::ReadlineError;
|
use rustyline::error::ReadlineError;
|
||||||
|
use rustyline::history::DefaultHistory;
|
||||||
use rustyline::{Config, Editor};
|
use rustyline::{Config, Editor};
|
||||||
|
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
@@ -109,7 +110,7 @@ fn get_prompt() -> &'static str {
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ReadlineStream {
|
pub struct ReadlineStream {
|
||||||
rl: Editor<Helper>,
|
rl: Editor<Helper, DefaultHistory>,
|
||||||
pending_input: CharReader<Cursor<String>>,
|
pending_input: CharReader<Cursor<String>>,
|
||||||
add_history: bool,
|
add_history: bool,
|
||||||
}
|
}
|
||||||
@@ -117,10 +118,13 @@ pub struct ReadlineStream {
|
|||||||
impl ReadlineStream {
|
impl ReadlineStream {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(pending_input: &str, add_history: bool) -> Self {
|
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 helper = Helper::new();
|
||||||
|
|
||||||
let mut rl = Editor::with_config(config);
|
let mut rl = Editor::with_config(config).unwrap();
|
||||||
rl.set_helper(Some(helper));
|
rl.set_helper(Some(helper));
|
||||||
|
|
||||||
if let Some(mut path) = dirs_next::home_dir() {
|
if let Some(mut path) = dirs_next::home_dir() {
|
||||||
@@ -130,8 +134,6 @@ impl ReadlineStream {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rl.bind_sequence(KeyEvent::from('\t'), Cmd::Insert(1, "\t".to_string()));
|
|
||||||
|
|
||||||
ReadlineStream {
|
ReadlineStream {
|
||||||
rl,
|
rl,
|
||||||
pending_input: CharReader::new(Cursor::new(pending_input.to_owned())),
|
pending_input: CharReader::new(Cursor::new(pending_input.to_owned())),
|
||||||
@@ -164,7 +166,7 @@ impl ReadlineStream {
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
if PROMPT {
|
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();
|
self.save_history();
|
||||||
PROMPT = false;
|
PROMPT = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user