remove EMIT_NEWLINE (#1900)

This commit is contained in:
Mark
2023-07-22 21:42:40 -06:00
parent 24450a8827
commit fd7f24e265
3 changed files with 3 additions and 14 deletions

View File

@@ -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);

View File

@@ -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,12 +163,10 @@ 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";
}
}
}
Ok(self.pending_input.get_ref().get_ref().len())
}