diff --git a/src/main.rs b/src/main.rs index 74ed593..b548fbc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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); } } diff --git a/src/sed/communication.rs b/src/sed/communication.rs index 16c7f4e..4147231 100644 --- a/src/sed/communication.rs +++ b/src/sed/communication.rs @@ -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(); @@ -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. @@ -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 @@ -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, @@ -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 = ""; @@ -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) diff --git a/src/sed/debugger.rs b/src/sed/debugger.rs index 943c989..330743c 100644 --- a/src/sed/debugger.rs +++ b/src/sed/debugger.rs @@ -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, - /// Previously visited debugging states, inclding the current one. + /// Previously visited debugging states, including the current one. state_frames: Vec, } impl Debugger { @@ -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, /// Output of sed command. Each vec item means one line. @@ -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, } diff --git a/src/sed/parser.rs b/src/sed/parser.rs index 3b45093..a75784a 100644 --- a/src/sed/parser.rs +++ b/src/sed/parser.rs @@ -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. @@ -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 diff --git a/src/ui/tui.rs b/src/ui/tui.rs index 30f601b..1e90f75 100644 --- a/src/ui/tui.rs +++ b/src/ui/tui.rs @@ -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 {