mirror of
https://github.com/lotabout/skim.git
synced 2026-09-09 23:06:17 -04:00
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>
This commit is contained in:
parent
926c76ee16
commit
5028ef4d0b
|
|
@ -268,7 +268,7 @@ page](https://github.com/skim-rs/skim/blob/master/man/man1/sk.1) (`man sk`).
|
|||
|
||||
- When using the `--split-match` option, each part around spaces or `|` will be matched in a split way:
|
||||
- If the option's value (defaulting to `:`) is absent from the query, do a normal match
|
||||
- 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.
|
||||
- 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.
|
||||
|
||||
If you prefer using regular expressions, `skim` offers a `regex` mode:
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
# sk-tmux: starts sk in a tmux pane
|
||||
# usage: sk-tmux [LAYOUT OPTIONS] [--] [SK OPTIONS]
|
||||
|
||||
echo "[WRN] This script is deprecated in favor or \`sk --tmux\` and will be removed in a later release" >&2
|
||||
echo "[WRN] This script is deprecated in favor of \`sk --tmux\` and will be removed in a later release" >&2
|
||||
|
||||
fail() {
|
||||
>&2 echo "$1"
|
||||
|
|
|
|||
|
|
@ -83,9 +83,9 @@ Start in regex mode instead of fuzzy\-match
|
|||
Fuzzy matching algorithm
|
||||
|
||||
arinae (ari) Latest algorithm
|
||||
skim_v2 Legacy skim algorithm
|
||||
`skim_v2` Legacy skim algorithm
|
||||
clangd Used in clangd for keyword completion
|
||||
fzy Algorithm from fzy (https://github.com/jhawthorn/fzy)
|
||||
fzy Algorithm from fzy (<https://github.com/jhawthorn/fzy>)
|
||||
.br
|
||||
|
||||
.br
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ impl SkimItem for DefaultSkimItem {
|
|||
// Combine styles: use highlight bg, preserve ANSI fg and modifiers
|
||||
new_spans.push(Span::styled(
|
||||
highlighted_content.clone(),
|
||||
merge_styles(base_style, context.matched_syle),
|
||||
merge_styles(base_style, context.matched_style),
|
||||
));
|
||||
highlighted_content.clear();
|
||||
}
|
||||
|
|
@ -336,7 +336,7 @@ impl SkimItem for DefaultSkimItem {
|
|||
// Combine styles: use highlight bg, preserve ANSI fg and modifiers
|
||||
new_spans.push(Span::styled(
|
||||
highlighted_content,
|
||||
merge_styles(base_style, context.matched_syle),
|
||||
merge_styles(base_style, context.matched_style),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -373,10 +373,10 @@ impl SkimItem for DefaultSkimItem {
|
|||
new_spans.push(Span::styled(before, merge_styles(context.base_style, base_style)));
|
||||
}
|
||||
if !highlighted.is_empty() {
|
||||
// Combine ANSI style with context matched_syle
|
||||
// Combine ANSI style with context matched_style
|
||||
new_spans.push(Span::styled(
|
||||
highlighted,
|
||||
merge_styles(base_style, context.matched_syle),
|
||||
merge_styles(base_style, context.matched_style),
|
||||
));
|
||||
}
|
||||
if !after.is_empty() {
|
||||
|
|
@ -421,10 +421,10 @@ impl SkimItem for DefaultSkimItem {
|
|||
new_spans.push(Span::styled(before, merge_styles(context.base_style, base_style)));
|
||||
}
|
||||
if !highlighted.is_empty() {
|
||||
// Combine ANSI style with context matched_syle
|
||||
// Combine ANSI style with context matched_style
|
||||
new_spans.push(Span::styled(
|
||||
highlighted,
|
||||
merge_styles(base_style, context.matched_syle),
|
||||
merge_styles(base_style, context.matched_style),
|
||||
));
|
||||
}
|
||||
if !after.is_empty() {
|
||||
|
|
@ -667,7 +667,7 @@ mod test {
|
|||
matches: Matches::CharRange(6, 10),
|
||||
container_width: 80,
|
||||
base_style: Style::default(),
|
||||
matched_syle: Style::default().fg(Color::Yellow),
|
||||
matched_style: Style::default().fg(Color::Yellow),
|
||||
};
|
||||
|
||||
// display() should map the match positions back to the original ANSI text
|
||||
|
|
@ -705,7 +705,7 @@ mod test {
|
|||
matches: Matches::CharIndices(vec![1, 2]),
|
||||
container_width: 80,
|
||||
base_style: Style::default(),
|
||||
matched_syle: Style::default().fg(Color::Yellow),
|
||||
matched_style: Style::default().fg(Color::Yellow),
|
||||
};
|
||||
|
||||
// display() should map these to positions 6,7 in original text
|
||||
|
|
@ -772,7 +772,7 @@ mod test {
|
|||
matches: Matches::CharIndices(vec![0]),
|
||||
container_width: 80,
|
||||
base_style: Style::default(),
|
||||
matched_syle: Style::default().bg(Color::Yellow),
|
||||
matched_style: Style::default().bg(Color::Yellow),
|
||||
};
|
||||
|
||||
let line = item.display(context);
|
||||
|
|
@ -810,7 +810,7 @@ mod test {
|
|||
matches: Matches::CharRange(1, 3),
|
||||
container_width: 80,
|
||||
base_style: Style::default(),
|
||||
matched_syle: Style::default().bg(Color::Yellow),
|
||||
matched_style: Style::default().bg(Color::Yellow),
|
||||
};
|
||||
|
||||
let line = item.display(context);
|
||||
|
|
@ -850,7 +850,7 @@ mod test {
|
|||
matches: Matches::ByteRange(1, 3),
|
||||
container_width: 80,
|
||||
base_style: Style::default(),
|
||||
matched_syle: Style::default().bg(Color::Yellow),
|
||||
matched_style: Style::default().bg(Color::Yellow),
|
||||
};
|
||||
|
||||
let line = item.display(context);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ impl RankBuilder {
|
|||
///
|
||||
/// The values are stored as-is; the tiebreak ordering and sign-flipping are
|
||||
/// applied lazily by [`Rank::sort_key`] at comparison time.
|
||||
/// The `index` will be overriden later
|
||||
/// The `index` will be overridden later
|
||||
#[must_use]
|
||||
pub fn build_rank(&self, score: i32, begin: usize, end: usize, item_text: &str) -> Rank {
|
||||
Rank {
|
||||
|
|
|
|||
17
src/lib.rs
17
src/lib.rs
|
|
@ -122,7 +122,7 @@ pub struct DisplayContext {
|
|||
/// The base style to apply to non-matched portions
|
||||
pub base_style: Style,
|
||||
/// The style to apply to matched portions
|
||||
pub matched_syle: Style,
|
||||
pub matched_style: Style,
|
||||
}
|
||||
|
||||
impl DisplayContext {
|
||||
|
|
@ -147,7 +147,10 @@ impl DisplayContext {
|
|||
res.push_span(Span::styled(span_content.collect::<String>(), self.base_style));
|
||||
let highlighted_char = chars.next().unwrap_or_default().to_string();
|
||||
|
||||
res.push_span(Span::styled(highlighted_char, self.base_style.patch(self.matched_syle)));
|
||||
res.push_span(Span::styled(
|
||||
highlighted_char,
|
||||
self.base_style.patch(self.matched_style),
|
||||
));
|
||||
prev_index = index + 1;
|
||||
}
|
||||
res.push_span(Span::styled(chars.collect::<String>(), self.base_style));
|
||||
|
|
@ -164,7 +167,10 @@ impl DisplayContext {
|
|||
));
|
||||
let highlighted_text = chars.by_ref().take(*end - *start).collect::<String>();
|
||||
|
||||
res.push_span(Span::styled(highlighted_text, self.base_style.patch(self.matched_syle)));
|
||||
res.push_span(Span::styled(
|
||||
highlighted_text,
|
||||
self.base_style.patch(self.matched_style),
|
||||
));
|
||||
res.push_span(Span::styled(chars.collect::<String>(), self.base_style));
|
||||
res
|
||||
}
|
||||
|
|
@ -178,7 +184,10 @@ impl DisplayContext {
|
|||
let highlighted_bytes = bytes.by_ref().take(*end - *start).collect();
|
||||
let highlighted_text = String::from_utf8(highlighted_bytes).unwrap();
|
||||
|
||||
res.push_span(Span::styled(highlighted_text, self.base_style.patch(self.matched_syle)));
|
||||
res.push_span(Span::styled(
|
||||
highlighted_text,
|
||||
self.base_style.patch(self.matched_style),
|
||||
));
|
||||
res.push_span(Span::styled(
|
||||
String::from_utf8(bytes.collect()).unwrap(),
|
||||
self.base_style,
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ impl Skim {
|
|||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics if the tui fails to initilize
|
||||
/// Panics if the tui fails to initialize
|
||||
pub fn run_with(options: SkimOptions, source: Option<SkimItemReceiver>) -> Result<SkimOutput> {
|
||||
trace!("running skim");
|
||||
let mut skim = Self::init(options, source)?;
|
||||
|
|
@ -348,7 +348,7 @@ where
|
|||
let reader_control = self
|
||||
.reader_control
|
||||
.as_ref()
|
||||
.expect("reader_control needs to be initilized using Skim::start");
|
||||
.expect("reader_control needs to be initialized using Skim::start");
|
||||
let app = &mut self.app;
|
||||
|
||||
// Filter mode: wait for all items to be read and matched, then return without entering TUI
|
||||
|
|
|
|||
|
|
@ -724,7 +724,7 @@ impl SkimWidget for ItemList {
|
|||
matches,
|
||||
container_width,
|
||||
base_style: if is_current { theme.current } else { theme.normal },
|
||||
matched_syle: if is_current { theme.current_match } else { theme.matched },
|
||||
matched_style: if is_current { theme.current_match } else { theme.matched },
|
||||
});
|
||||
|
||||
if !wrap {
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ impl Preview {
|
|||
self.rows, self.cols
|
||||
);
|
||||
self.init_pty();
|
||||
trace!("initalized pty");
|
||||
trace!("initialized pty");
|
||||
let mut shell_cmd = portable_pty::CommandBuilder::new("/bin/sh");
|
||||
shell_cmd.env("ROWS", self.rows.to_string());
|
||||
shell_cmd.env("COLUMNS", self.cols.to_string());
|
||||
|
|
|
|||
Loading…
Reference in a new issue