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