Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ fn main() {
let mut clear_terminal: bool = true;

if let Err(error) = run(0) {
eprintln!("An error occured: {}", error);
eprintln!("An error occurred: {}", error);
clear_terminal = false;
}
if let Err(error) = Tui::restore_terminal_state(clear_terminal) {
eprintln!("An error occured while attempting to reset terminal to previous state. Consider using 'reset' command. Error: {}", error);
eprintln!("An error occurred while attempting to reset terminal to previous state. Consider using 'reset' command. Error: {}", error);
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/sed/communication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl SedCommunicator {
if self.options.verbose {
eprintln!(
"[Info] Sed failed and didn't return any output. As sed path wasn't specified, trying again with \"gsed\". If even that won't work, make sure \
sed is able to process your script. Most common mistake is forgeting to use -E."
sed is able to process your script. Most common mistake is forgetting to use -E."
);
}
return self.get_sed_output();
Expand Down Expand Up @@ -115,7 +115,7 @@ impl SedCommunicator {
/// ```
/// There might be multiple commands within one input line. The example continues:
/// ```sh
/// COMMNAD: =
/// COMMAND: =
/// 1
/// ```
/// That was it, that was whole command. Notice the output of the command.
Expand All @@ -125,7 +125,7 @@ impl SedCommunicator {
/// COMMAND: d
/// END-OF-CYCLE
/// ```
/// And another segment begins. Note that we don't differentiate within segments inside the result iself,
/// And another segment begins. Note that we don't differentiate within segments inside the result itself,
/// but we need to during parsing.
/// ```sh
/// INPUT: 'input.txt' line 2
Expand All @@ -151,7 +151,7 @@ impl SedCommunicator {
/// hello # Value printed to stdout. This tends to come after COMMAND or END-OF-CYCLE.
/// ```
///
/// This returns individual frames *and* output of the last segement of the sed script.
/// This returns individual frames *and* output of the last segment of the sed script.
fn parse_state_frames(
&self,
sed_output: &str,
Expand Down Expand Up @@ -231,7 +231,7 @@ impl SedCommunicator {
continue;
}
match line {
// Do not record INPUT lines, but reset line number, previous command and patern space.
// Do not record INPUT lines, but reset line number, previous command and pattern space.
x if x.starts_with("INPUT:") => {
sed_line = 0;
current_pattern = "";
Expand Down Expand Up @@ -346,8 +346,8 @@ impl SedCommunicator {
}
}
// Conditional jump
// Jump only if last substition was succesful
// (or, in case of T, only if the last substituion was not succesful)
// Jump only if last substitution was successful
// (or, in case of T, only if the last substitution was not successful)
x if x.starts_with("t") | x.starts_with("T") => {
if (x.starts_with("t") && last_match_successful)
|| (x.starts_with("T") && !last_match_successful)
Expand Down
6 changes: 3 additions & 3 deletions src/sed/debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct Debugger {
/// If there were multiple instructions on a single line in original source code,
/// they are spread out so one is on each line.
pub source_code: Vec<String>,
/// Previously visited debugging states, inclding the current one.
/// Previously visited debugging states, including the current one.
state_frames: Vec<DebuggingState>,
}
impl Debugger {
Expand Down Expand Up @@ -74,7 +74,7 @@ pub struct DebuggingState {
/// State of secondary, or hold, buffer
pub hold_buffer: String,
/// If any regex was matched within the last execution step, the capture groups
/// wil be saved here. If the previously executed instruction was not a substitution,
/// will be saved here. If the previously executed instruction was not a substitution,
/// this will be empty.
pub matched_regex_registers: Vec<String>,
/// Output of sed command. Each vec item means one line.
Expand All @@ -85,6 +85,6 @@ pub struct DebuggingState {
pub current_line: usize,
/// Command executed by sed. With a bit of luck, this should match command referenced
/// by current_line. If these two don't match, this one (`sed_command`) is right and
/// a bug in parsing code occured.
/// a bug in parsing code occurred.
pub sed_command: Option<String>,
}
4 changes: 2 additions & 2 deletions src/sed/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use logos::{Lexer, Logos};
/// ```
/// There might be multiple commands within one input line. The example continues:
/// ```sh
/// COMMNAD: =
/// COMMAND: =
/// 1
/// ```
/// That was it, that was whole command. Notice the output of the command.
Expand All @@ -22,7 +22,7 @@ use logos::{Lexer, Logos};
/// COMMAND: d
/// END-OF-CYCLE
/// ```
/// And another segment begins. Note that we don't differentiate within segments inside the result iself,
/// And another segment begins. Note that we don't differentiate within segments inside the result itself,
/// but we need to during parsing.
/// ```sh
/// INPUT: 'input.txt' line 2
Expand Down
2 changes: 1 addition & 1 deletion src/ui/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ impl UiAgent for Tui<'_> {
let tick_rate = Duration::from_millis(self.forced_refresh_rate);
let mut file_watcher = self.file_watcher;

// Thread that will send interrupt singals to UI thread (this one)
// Thread that will send interrupt signals to UI thread (this one)
thread::spawn(move || {
let mut last_tick = Instant::now();
loop {
Expand Down
Loading