Skip to content

Commit 5028ef4

Browse files
dexzhSkim bot
andauthored
chore: correct typos in code, comments and documentation (#1002)
* fix: correct typos in code, comments and documentation * chore: generate completions & manpage --------- Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
1 parent 926c76e commit 5028ef4

File tree

9 files changed

+33
-24
lines changed

9 files changed

+33
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ page](https://github.com/skim-rs/skim/blob/master/man/man1/sk.1) (`man sk`).
268268
269269
- When using the `--split-match` option, each part around spaces or `|` will be matched in a split way:
270270
- If the option's value (defaulting to `:`) is absent from the query, do a normal match
271-
- If it is present, match everything before to everything before it in the items, and everything after it (including potential other occurences of the delimiter) to the part after it in the items. This is particularly useful when piping in input from `rg` to match on both file name and content.
271+
- If it is present, match everything before to everything before it in the items, and everything after it (including potential other occurrences of the delimiter) to the part after it in the items. This is particularly useful when piping in input from `rg` to match on both file name and content.
272272
273273
If you prefer using regular expressions, `skim` offers a `regex` mode:
274274

bin/sk-tmux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# sk-tmux: starts sk in a tmux pane
2929
# usage: sk-tmux [LAYOUT OPTIONS] [--] [SK OPTIONS]
3030

31-
echo "[WRN] This script is deprecated in favor or \`sk --tmux\` and will be removed in a later release" >&2
31+
echo "[WRN] This script is deprecated in favor of \`sk --tmux\` and will be removed in a later release" >&2
3232

3333
fail() {
3434
>&2 echo "$1"

man/man1/sk.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ Start in regex mode instead of fuzzy\-match
8383
Fuzzy matching algorithm
8484

8585
arinae (ari) Latest algorithm
86-
skim_v2 Legacy skim algorithm
86+
`skim_v2` Legacy skim algorithm
8787
clangd Used in clangd for keyword completion
88-
fzy Algorithm from fzy (https://github.com/jhawthorn/fzy)
88+
fzy Algorithm from fzy (<https://github.com/jhawthorn/fzy>)
8989
.br
9090

9191
.br

src/helper/item.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ impl SkimItem for DefaultSkimItem {
315315
// Combine styles: use highlight bg, preserve ANSI fg and modifiers
316316
new_spans.push(Span::styled(
317317
highlighted_content.clone(),
318-
merge_styles(base_style, context.matched_syle),
318+
merge_styles(base_style, context.matched_style),
319319
));
320320
highlighted_content.clear();
321321
}
@@ -336,7 +336,7 @@ impl SkimItem for DefaultSkimItem {
336336
// Combine styles: use highlight bg, preserve ANSI fg and modifiers
337337
new_spans.push(Span::styled(
338338
highlighted_content,
339-
merge_styles(base_style, context.matched_syle),
339+
merge_styles(base_style, context.matched_style),
340340
));
341341
}
342342
}
@@ -373,10 +373,10 @@ impl SkimItem for DefaultSkimItem {
373373
new_spans.push(Span::styled(before, merge_styles(context.base_style, base_style)));
374374
}
375375
if !highlighted.is_empty() {
376-
// Combine ANSI style with context matched_syle
376+
// Combine ANSI style with context matched_style
377377
new_spans.push(Span::styled(
378378
highlighted,
379-
merge_styles(base_style, context.matched_syle),
379+
merge_styles(base_style, context.matched_style),
380380
));
381381
}
382382
if !after.is_empty() {
@@ -421,10 +421,10 @@ impl SkimItem for DefaultSkimItem {
421421
new_spans.push(Span::styled(before, merge_styles(context.base_style, base_style)));
422422
}
423423
if !highlighted.is_empty() {
424-
// Combine ANSI style with context matched_syle
424+
// Combine ANSI style with context matched_style
425425
new_spans.push(Span::styled(
426426
highlighted,
427-
merge_styles(base_style, context.matched_syle),
427+
merge_styles(base_style, context.matched_style),
428428
));
429429
}
430430
if !after.is_empty() {
@@ -667,7 +667,7 @@ mod test {
667667
matches: Matches::CharRange(6, 10),
668668
container_width: 80,
669669
base_style: Style::default(),
670-
matched_syle: Style::default().fg(Color::Yellow),
670+
matched_style: Style::default().fg(Color::Yellow),
671671
};
672672

673673
// display() should map the match positions back to the original ANSI text
@@ -705,7 +705,7 @@ mod test {
705705
matches: Matches::CharIndices(vec![1, 2]),
706706
container_width: 80,
707707
base_style: Style::default(),
708-
matched_syle: Style::default().fg(Color::Yellow),
708+
matched_style: Style::default().fg(Color::Yellow),
709709
};
710710

711711
// display() should map these to positions 6,7 in original text
@@ -772,7 +772,7 @@ mod test {
772772
matches: Matches::CharIndices(vec![0]),
773773
container_width: 80,
774774
base_style: Style::default(),
775-
matched_syle: Style::default().bg(Color::Yellow),
775+
matched_style: Style::default().bg(Color::Yellow),
776776
};
777777

778778
let line = item.display(context);
@@ -810,7 +810,7 @@ mod test {
810810
matches: Matches::CharRange(1, 3),
811811
container_width: 80,
812812
base_style: Style::default(),
813-
matched_syle: Style::default().bg(Color::Yellow),
813+
matched_style: Style::default().bg(Color::Yellow),
814814
};
815815

816816
let line = item.display(context);
@@ -850,7 +850,7 @@ mod test {
850850
matches: Matches::ByteRange(1, 3),
851851
container_width: 80,
852852
base_style: Style::default(),
853-
matched_syle: Style::default().bg(Color::Yellow),
853+
matched_style: Style::default().bg(Color::Yellow),
854854
};
855855

856856
let line = item.display(context);

src/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl RankBuilder {
6363
///
6464
/// The values are stored as-is; the tiebreak ordering and sign-flipping are
6565
/// applied lazily by [`Rank::sort_key`] at comparison time.
66-
/// The `index` will be overriden later
66+
/// The `index` will be overridden later
6767
#[must_use]
6868
pub fn build_rank(&self, score: i32, begin: usize, end: usize, item_text: &str) -> Rank {
6969
Rank {

src/lib.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub struct DisplayContext {
122122
/// The base style to apply to non-matched portions
123123
pub base_style: Style,
124124
/// The style to apply to matched portions
125-
pub matched_syle: Style,
125+
pub matched_style: Style,
126126
}
127127

128128
impl DisplayContext {
@@ -147,7 +147,10 @@ impl DisplayContext {
147147
res.push_span(Span::styled(span_content.collect::<String>(), self.base_style));
148148
let highlighted_char = chars.next().unwrap_or_default().to_string();
149149

150-
res.push_span(Span::styled(highlighted_char, self.base_style.patch(self.matched_syle)));
150+
res.push_span(Span::styled(
151+
highlighted_char,
152+
self.base_style.patch(self.matched_style),
153+
));
151154
prev_index = index + 1;
152155
}
153156
res.push_span(Span::styled(chars.collect::<String>(), self.base_style));
@@ -164,7 +167,10 @@ impl DisplayContext {
164167
));
165168
let highlighted_text = chars.by_ref().take(*end - *start).collect::<String>();
166169

167-
res.push_span(Span::styled(highlighted_text, self.base_style.patch(self.matched_syle)));
170+
res.push_span(Span::styled(
171+
highlighted_text,
172+
self.base_style.patch(self.matched_style),
173+
));
168174
res.push_span(Span::styled(chars.collect::<String>(), self.base_style));
169175
res
170176
}
@@ -178,7 +184,10 @@ impl DisplayContext {
178184
let highlighted_bytes = bytes.by_ref().take(*end - *start).collect();
179185
let highlighted_text = String::from_utf8(highlighted_bytes).unwrap();
180186

181-
res.push_span(Span::styled(highlighted_text, self.base_style.patch(self.matched_syle)));
187+
res.push_span(Span::styled(
188+
highlighted_text,
189+
self.base_style.patch(self.matched_style),
190+
));
182191
res.push_span(Span::styled(
183192
String::from_utf8(bytes.collect()).unwrap(),
184193
self.base_style,

src/skim.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Skim {
5252
///
5353
/// # Panics
5454
///
55-
/// Panics if the tui fails to initilize
55+
/// Panics if the tui fails to initialize
5656
pub fn run_with(options: SkimOptions, source: Option<SkimItemReceiver>) -> Result<SkimOutput> {
5757
trace!("running skim");
5858
let mut skim = Self::init(options, source)?;
@@ -348,7 +348,7 @@ where
348348
let reader_control = self
349349
.reader_control
350350
.as_ref()
351-
.expect("reader_control needs to be initilized using Skim::start");
351+
.expect("reader_control needs to be initialized using Skim::start");
352352
let app = &mut self.app;
353353

354354
// Filter mode: wait for all items to be read and matched, then return without entering TUI

src/tui/item_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ impl SkimWidget for ItemList {
724724
matches,
725725
container_width,
726726
base_style: if is_current { theme.current } else { theme.normal },
727-
matched_syle: if is_current { theme.current_match } else { theme.matched },
727+
matched_style: if is_current { theme.current_match } else { theme.matched },
728728
});
729729

730730
if !wrap {

src/tui/preview.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ impl Preview {
303303
self.rows, self.cols
304304
);
305305
self.init_pty();
306-
trace!("initalized pty");
306+
trace!("initialized pty");
307307
let mut shell_cmd = portable_pty::CommandBuilder::new("/bin/sh");
308308
shell_cmd.env("ROWS", self.rows.to_string());
309309
shell_cmd.env("COLUMNS", self.cols.to_string());

0 commit comments

Comments
 (0)