Skip to content

Commit

Permalink
undo: most of configurable immediately execution of bashisms
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdgo committed Sep 14, 2024
1 parent 8090786 commit 8aff403
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ pub struct Reedline {
/// A ReedlineEvent Sender, use this to submit events to the queue
pub reedline_event_sender: Sender<ReedlineEvent>,
reedline_event_receiver: Receiver<ReedlineEvent>,
#[cfg(feature = "bashisms")]
immediately_accept_bashisms: bool,
}

struct BufferEditor {
Expand Down Expand Up @@ -249,17 +247,9 @@ impl Reedline {
external_printer: None,
reedline_event_receiver,
reedline_event_sender,
#[cfg(feature = "bashisms")]
immediately_accept_bashisms: false,
}
}

#[cfg(feature = "bashisms")]
pub fn with_immediately_accept_bashisms(mut self, accept: bool) -> Self {
self.immediately_accept_bashisms = accept;
self
}

/// Get a new history session id based on the current time and the first commit datetime of reedline
pub fn create_history_session_id() -> Option<HistorySessionId> {
let nanos = match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) {
Expand Down Expand Up @@ -1672,11 +1662,11 @@ impl Reedline {
.map(|token| (parsed.remainder.len(), indicator.len(), token.to_string())),
});

if self.immediately_accept_bashisms {
if let Err(_e) = self.reedline_event_sender.send(ReedlineEvent::Submit) {
// handle or log _e
}
}
// if self.immediately_accept_bashisms {
// if let Err(_e) = self.reedline_event_sender.send(ReedlineEvent::Submit) {
// // handle or log _e
// }
// }

if let Some((start, size, history)) = history_result {
let edits = vec![
Expand Down

0 comments on commit 8aff403

Please sign in to comment.