remove EMIT_NEWLINE (#1900)
This commit is contained in:
@@ -437,7 +437,7 @@ impl Machine {
|
|||||||
user_error,
|
user_error,
|
||||||
load_contexts: vec![],
|
load_contexts: vec![],
|
||||||
runtime,
|
runtime,
|
||||||
foreign_function_table: Default::default(),
|
foreign_function_table: Default::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut lib_path = current_dir();
|
let mut lib_path = current_dir();
|
||||||
|
|||||||
@@ -5797,7 +5797,6 @@ impl Machine {
|
|||||||
pub(crate) fn read_query_term(&mut self) -> CallResult {
|
pub(crate) fn read_query_term(&mut self) -> CallResult {
|
||||||
self.user_input.reset();
|
self.user_input.reset();
|
||||||
|
|
||||||
set_emit_newline(true);
|
|
||||||
set_prompt(true);
|
set_prompt(true);
|
||||||
// let result = self.machine_st.read_term(self.user_input, &mut self.indices);
|
// let result = self.machine_st.read_term(self.user_input, &mut self.indices);
|
||||||
let result = self.machine_st.read_term_from_user_input(self.user_input, &mut self.indices);
|
let result = self.machine_st.read_term_from_user_input(self.user_input, &mut self.indices);
|
||||||
|
|||||||
14
src/read.rs
14
src/read.rs
@@ -81,16 +81,8 @@ impl MachineState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static mut PROMPT: bool = false;
|
static mut PROMPT: bool = false;
|
||||||
static mut EMIT_NEWLINE: bool = false;
|
|
||||||
|
|
||||||
const HISTORY_FILE: &'static str = ".scryer_history";
|
const HISTORY_FILE: &'static str = ".scryer_history";
|
||||||
|
|
||||||
pub(crate) fn set_emit_newline(value: bool) {
|
|
||||||
unsafe {
|
|
||||||
EMIT_NEWLINE = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn set_prompt(value: bool) {
|
pub(crate) fn set_prompt(value: bool) {
|
||||||
unsafe {
|
unsafe {
|
||||||
PROMPT = value;
|
PROMPT = value;
|
||||||
@@ -171,10 +163,8 @@ impl ReadlineStream {
|
|||||||
PROMPT = false;
|
PROMPT = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if EMIT_NEWLINE {
|
if self.pending_input.get_ref().get_ref().chars().last() != Some('\n') {
|
||||||
if self.pending_input.get_ref().get_ref().chars().last() != Some('\n') {
|
*self.pending_input.get_mut().get_mut() += "\n";
|
||||||
*self.pending_input.get_mut().get_mut() += "\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user