diff options
author | extrawurst <mail@rusticorn.com> | 2024-02-20 19:51:05 +0100 |
---|---|---|
committer | extrawurst <mail@rusticorn.com> | 2024-02-20 19:51:05 +0100 |
commit | 2bbaa6f3a196bf3bfd36b9724dfb74e076493893 (patch) | |
tree | 93ed5342bd37dd1bda4f80c452dae9db47e0a739 /src | |
parent | 5dad9f4adbd29ab33a839d74a1267d744437f032 (diff) |
fix a bunch more typos
Diffstat (limited to 'src')
-rw-r--r-- | src/components/changes.rs | 4 | ||||
-rw-r--r-- | src/components/commit_details/details.rs | 2 | ||||
-rw-r--r-- | src/components/commit_details/style.rs | 4 | ||||
-rw-r--r-- | src/components/status_tree.rs | 2 | ||||
-rw-r--r-- | src/components/utils/logitems.rs | 2 | ||||
-rw-r--r-- | src/components/utils/mod.rs | 2 | ||||
-rw-r--r-- | src/components/utils/statustree.rs | 36 | ||||
-rw-r--r-- | src/keys/key_list.rs | 8 | ||||
-rw-r--r-- | src/options.rs | 5 | ||||
-rw-r--r-- | src/popups/commit.rs | 8 | ||||
-rw-r--r-- | src/popups/fuzzy_find.rs | 4 | ||||
-rw-r--r-- | src/popups/log_search.rs | 2 | ||||
-rw-r--r-- | src/popups/submodules.rs | 6 | ||||
-rw-r--r-- | src/popups/taglist.rs | 6 | ||||
-rw-r--r-- | src/strings.rs | 5 | ||||
-rw-r--r-- | src/tabs/revlog.rs | 4 | ||||
-rw-r--r-- | src/tabs/status.rs | 4 | ||||
-rw-r--r-- | src/ui/reflow.rs | 4 |
18 files changed, 55 insertions, 53 deletions
diff --git a/src/components/changes.rs b/src/components/changes.rs index e2a32cb0..cf241156 100644 --- a/src/components/changes.rs +++ b/src/components/changes.rs @@ -72,8 +72,8 @@ impl ChangesComponent { } /// - pub fn is_file_seleted(&self) -> bool { - self.files.is_file_seleted() + pub fn is_file_selected(&self) -> bool { + self.files.is_file_selected() } fn index_add_remove(&mut self) -> Result<bool> { diff --git a/src/components/commit_details/details.rs b/src/components/commit_details/details.rs index 95e4737e..986a1af2 100644 --- a/src/components/commit_details/details.rs +++ b/src/components/commit_details/details.rs @@ -184,7 +184,7 @@ impl DetailsComponent { if let Some(ref committer) = data.committer { res.extend(vec![ Line::from(vec![ - style_detail(&self.theme, &Detail::Commiter), + style_detail(&self.theme, &Detail::Committer), Span::styled( Cow::from(format!( "{} <{}>", diff --git a/src/components/commit_details/style.rs b/src/components/commit_details/style.rs index 5082497c..7a077594 100644 --- a/src/components/commit_details/style.rs +++ b/src/components/commit_details/style.rs @@ -5,7 +5,7 @@ use std::borrow::Cow; pub enum Detail { Author, Date, - Commiter, + Committer, Sha, Message, } @@ -23,7 +23,7 @@ pub fn style_detail<'a>( Cow::from(strings::commit::details_date()), theme.text(false, false), ), - Detail::Commiter => Span::styled( + Detail::Committer => Span::styled( Cow::from(strings::commit::details_committer()), theme.text(false, false), ), diff --git a/src/components/status_tree.rs b/src/components/status_tree.rs index 8aa58ce7..af0cde79 100644 --- a/src/components/status_tree.rs +++ b/src/components/status_tree.rs @@ -119,7 +119,7 @@ impl StatusTreeComponent { } /// - pub fn is_file_seleted(&self) -> bool { + pub fn is_file_selected(&self) -> bool { self.tree.selected_item().map_or(false, |item| { match item.kind { FileTreeItemKind::File(_) => true, diff --git a/src/components/utils/logitems.rs b/src/components/utils/logitems.rs index 73f7fffd..4534f225 100644 --- a/src/components/utils/logitems.rs +++ b/src/components/utils/logitems.rs @@ -109,7 +109,7 @@ impl ItemBatch { self.items.iter() } - /// clear curent list of items + /// clear current list of items pub fn clear(&mut self) { self.items.clear(); self.index_offset = None; diff --git a/src/components/utils/mod.rs b/src/components/utils/mod.rs index 7d32a40f..54298d7a 100644 --- a/src/components/utils/mod.rs +++ b/src/components/utils/mod.rs @@ -26,7 +26,7 @@ macro_rules! try_or_popup { }; } -/// helper func to convert unix time since epoch to formated time string in local timezone +/// helper func to convert unix time since epoch to formatted time string in local timezone pub fn time_to_string(secs: i64, short: bool) -> String { let time = DateTime::<Local>::from( DateTime::<Utc>::from_naive_utc_and_offset( diff --git a/src/components/utils/statustree.rs b/src/components/utils/statustree.rs index 92595843..4b3384d7 100644 --- a/src/components/utils/statustree.rs +++ b/src/components/utils/statustree.rs @@ -444,7 +444,7 @@ mod tests { .collect::<Vec<_>>() } - fn get_visibles(tree: &StatusTree) -> Vec<bool> { + fn get_visible(tree: &StatusTree) -> Vec<bool> { tree.tree .items() .iter() @@ -503,7 +503,7 @@ mod tests { res.update(&string_vec_to_status(&["a/b"])).unwrap(); assert_eq!( - get_visibles(&res), + get_visible(&res), vec![ true, // false, // @@ -533,7 +533,7 @@ mod tests { ); assert_eq!( - get_visibles(&res), + get_visible(&res), vec![ true, // false, // @@ -554,7 +554,7 @@ mod tests { ); assert_eq!( - get_visibles(&res), + get_visible(&res), vec![ true, // false, // @@ -581,10 +581,10 @@ mod tests { res.collapse(&String::from("a/b"), 1); - let visibles = get_visibles(&res); + let visible = get_visible(&res); assert_eq!( - visibles, + visible, vec![ true, // true, // @@ -595,10 +595,10 @@ mod tests { res.expand(&String::from("a/b"), 1); - let visibles = get_visibles(&res); + let visible = get_visible(&res); assert_eq!( - visibles, + visible, vec![ true, // true, // @@ -628,7 +628,7 @@ mod tests { res.collapse(&String::from("a"), 0); assert_eq!( - get_visibles(&res), + get_visible(&res), vec![ true, // false, // @@ -641,7 +641,7 @@ mod tests { res.expand(&String::from("a"), 0); assert_eq!( - get_visibles(&res), + get_visible(&res), vec![ true, // true, // @@ -669,10 +669,10 @@ mod tests { res.collapse(&String::from("a"), 0); - let visibles = get_visibles(&res); + let visible = get_visible(&res); assert_eq!( - visibles, + visible, vec![ true, // false, // @@ -699,10 +699,10 @@ mod tests { res.collapse(&String::from("a/b"), 1); - let visibles = get_visibles(&res); + let visible = get_visible(&res); assert_eq!( - visibles, + visible, vec![ true, // true, // @@ -713,10 +713,10 @@ mod tests { res.collapse(&String::from("a"), 0); - let visibles = get_visibles(&res); + let visible = get_visible(&res); assert_eq!( - visibles, + visible, vec![ true, // false, // @@ -727,10 +727,10 @@ mod tests { res.expand(&String::from("a"), 0); - let visibles = get_visibles(&res); + let visible = get_visible(&res); assert_eq!( - visibles, + visible, vec![ true, // true, // diff --git a/src/keys/key_list.rs b/src/keys/key_list.rs index b6e9c328..71e6756d 100644 --- a/src/keys/key_list.rs +++ b/src/keys/key_list.rs @@ -85,8 +85,8 @@ pub struct KeysList { pub log_tag_commit: GituiKeyEvent, pub log_mark_commit: GituiKeyEvent, pub log_checkout_commit: GituiKeyEvent, - pub log_reset_comit: GituiKeyEvent, - pub log_reword_comit: GituiKeyEvent, + pub log_reset_commit: GituiKeyEvent, + pub log_reword_commit: GituiKeyEvent, pub log_find: GituiKeyEvent, pub find_commit_sha: GituiKeyEvent, pub commit_amend: GituiKeyEvent, @@ -176,8 +176,8 @@ impl Default for KeysList { log_tag_commit: GituiKeyEvent::new(KeyCode::Char('t'), KeyModifiers::empty()), log_mark_commit: GituiKeyEvent::new(KeyCode::Char(' '), KeyModifiers::empty()), log_checkout_commit: GituiKeyEvent { code: KeyCode::Char('S'), modifiers: KeyModifiers::SHIFT }, - log_reset_comit: GituiKeyEvent { code: KeyCode::Char('R'), modifiers: KeyModifiers::SHIFT }, - log_reword_comit: GituiKeyEvent { code: KeyCode::Char('r'), modifiers: KeyModifiers::empty() }, + log_reset_commit: GituiKeyEvent { code: KeyCode::Char('R'), modifiers: KeyModifiers::SHIFT }, + log_reword_commit: GituiKeyEvent { code: KeyCode::Char('r'), modifiers: KeyModifiers::empty() }, log_find: GituiKeyEvent { code: KeyCode::Char('f'), modifiers: KeyModifiers::empty() }, find_commit_sha: GituiKeyEvent::new(KeyCode::Char('j'), KeyModifiers::CONTROL), commit_amend: GituiKeyEvent::new(KeyCode::Char('a'), KeyModifiers::CONTROL), diff --git a/src/options.rs b/src/options.rs index 87f92aeb..db048020 100644 --- a/src/options.rs +++ b/src/options.rs @@ -24,7 +24,7 @@ struct OptionsData { pub commit_msgs: Vec<String>, } -const COMMIT_MSG_HISTRY_LENGTH: usize = 20; +const COMMIT_MSG_HISTORY_LENGTH: usize = 20; #[derive(Clone)] pub struct Options { @@ -109,7 +109,8 @@ impl Options { pub fn add_commit_msg(&mut self, msg: &str) { self.data.commit_msgs.push(msg.to_owned()); - while self.data.commit_msgs.len() > COMMIT_MSG_HISTRY_LENGTH { + while self.data.commit_msgs.len() > COMMIT_MSG_HISTORY_LENGTH + { self.data.commit_msgs.remove(0); } self.save(); diff --git a/src/popups/commit.rs b/src/popups/commit.rs index 7385c004..2511d8b8 100644 --- a/src/popups/commit.rs +++ b/src/popups/commit.rs @@ -36,7 +36,7 @@ use std::{ use super::ExternalEditorPopup; enum CommitResult { - ComitDone, + CommitDone, Aborted, } @@ -172,7 +172,7 @@ impl CommitPopup { .as_bytes(), )?; - file.write_all(b"\n#\n# Changes to be commited:")?; + file.write_all(b"\n#\n# Changes to be committed:")?; for change in changes { let status_char = @@ -218,7 +218,7 @@ impl CommitPopup { if matches!( self.commit_with_msg(msg)?, - CommitResult::ComitDone + CommitResult::CommitDone ) { self.options .borrow_mut() @@ -279,7 +279,7 @@ impl CommitPopup { ))); } - Ok(CommitResult::ComitDone) + Ok(CommitResult::CommitDone) } fn do_commit(&self, msg: &str) -> Result<()> { diff --git a/src/popups/fuzzy_find.rs b/src/popups/fuzzy_find.rs index ccee1b9c..507b64e1 100644 --- a/src/popups/fuzzy_find.rs +++ b/src/popups/fuzzy_find.rs @@ -187,7 +187,7 @@ impl FuzzyFindPopup { .iter() .skip(scroll_skip) .take(height) - .map(|(idx, indicies)| { + .map(|(idx, indices)| { let selected = self .selected_index .map_or(false, |index| index == *idx); @@ -205,7 +205,7 @@ impl FuzzyFindPopup { Cow::from(c.to_string()), self.theme.text( selected, - indicies.contains( + indices.contains( &(c_idx + trim_length), ), ), diff --git a/src/popups/log_search.rs b/src/popups/log_search.rs index e7e868ad..2513d7ec 100644 --- a/src/popups/log_search.rs +++ b/src/popups/log_search.rs @@ -245,7 +245,7 @@ impl LogSearchPopupPopup { ), )]), Line::from(vec![Span::styled( - format!("[{x_files}] commited files",), + format!("[{x_files}] committed files",), self.theme.text( matches!( self.selection, diff --git a/src/popups/submodules.rs b/src/popups/submodules.rs index 8a758a49..5a6fa122 100644 --- a/src/popups/submodules.rs +++ b/src/popups/submodules.rs @@ -318,10 +318,10 @@ impl SubmodulesListPopup { fn set_selection(&mut self, selection: u16) -> Result<()> { let num_entriess: u16 = self.submodules.len().try_into()?; - let num_entriess = num_entriess.saturating_sub(1); + let num_entries = num_entriess.saturating_sub(1); - let selection = if selection > num_entriess { - num_entriess + let selection = if selection > num_entries { + num_entries } else { selection }; diff --git a/src/popups/taglist.rs b/src/popups/taglist.rs index ce3da32c..bc902c26 100644 --- a/src/popups/taglist.rs +++ b/src/popups/taglist.rs @@ -83,7 +83,7 @@ impl DrawableComponent for TagListPopup { Constraint::Length(10), // author width Constraint::Length(19), - // attachement + // attachment Constraint::Length(1), // commit id Constraint::Percentage(100), @@ -443,7 +443,7 @@ impl TagListPopup { /// fn get_row(&self, tag: &TagWithMetadata) -> Row { const UPSTREAM_SYMBOL: &str = "\u{2191}"; - const ATTACHEMENT_SYMBOL: &str = "@"; + const ATTACHMENT_SYMBOL: &str = "@"; const EMPTY_SYMBOL: &str = " "; let is_tag_missing_on_remote = self @@ -462,7 +462,7 @@ impl TagListPopup { }; let has_attachement_str = if tag.annotation.is_some() { - ATTACHEMENT_SYMBOL + ATTACHMENT_SYMBOL } else { EMPTY_SYMBOL }; diff --git a/src/strings.rs b/src/strings.rs index 0fc19c10..a369a869 100644 --- a/src/strings.rs +++ b/src/strings.rs @@ -1356,7 +1356,7 @@ pub mod commands { CommandText::new( format!( "Reset [{}]", - key_config.get_hint(key_config.keys.log_reset_comit), + key_config.get_hint(key_config.keys.log_reset_commit), ), "reset to commit", CMD_GROUP_LOG, @@ -1368,7 +1368,8 @@ pub mod commands { CommandText::new( format!( "Reword [{}]", - key_config.get_hint(key_config.keys.log_reword_comit), + key_config + .get_hint(key_config.keys.log_reword_commit), ), "reword commit message", CMD_GROUP_LOG, diff --git a/src/tabs/revlog.rs b/src/tabs/revlog.rs index 41694862..524550dd 100644 --- a/src/tabs/revlog.rs +++ b/src/tabs/revlog.rs @@ -542,7 +542,7 @@ impl Component for Revlog { return Ok(EventState::Consumed); } else if key_match( k, - self.key_config.keys.log_reset_comit, + self.key_config.keys.log_reset_commit, ) && !self.is_search_pending() { return self.selected_commit().map_or( @@ -556,7 +556,7 @@ impl Component for Revlog { ); } else if key_match( k, - self.key_config.keys.log_reword_comit, + self.key_config.keys.log_reword_commit, ) && !self.is_search_pending() { return self.selected_commit().map_or( diff --git a/src/tabs/status.rs b/src/tabs/status.rs index 47548565..67605f8e 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -311,8 +311,8 @@ impl Status { fn can_focus_diff(&self) -> bool { match self.focus { - Focus::WorkDir => self.index_wd.is_file_seleted(), - Focus::Stage => self.index.is_file_seleted(), + Focus::WorkDir => self.index_wd.is_file_selected(), + Focus::Stage => self.index.is_file_selected(), Focus::Diff => false, } } diff --git a/src/ui/reflow.rs b/src/ui/reflow.rs index 028d9b21..8b9c3cde 100644 --- a/src/ui/reflow.rs +++ b/src/ui/reflow.rs @@ -144,7 +144,7 @@ pub struct LineTruncator<'a, 'b> { symbols: &'b mut dyn Iterator<Item = StyledGrapheme<'a>>, max_line_width: u16, current_line: Vec<StyledGrapheme<'a>>, - /// Record the offet to skip render + /// Record the offset to skip render horizontal_offset: u16, } @@ -509,7 +509,7 @@ mod test { assert_eq!(line_truncator, vec![" "]); } - /// Tests an input starting with a letter, folowed by spaces - some of the behaviour is + /// Tests an input starting with a letter, followed by spaces - some of the behaviour is /// incidental. #[test] fn line_composer_char_plus_lots_of_spaces() { |