aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/document.rs8
-rw-r--r--helix-term/src/ui/fuzzy_match.rs6
-rw-r--r--helix-term/src/ui/fuzzy_match/test.rs4
-rw-r--r--helix-term/src/ui/overlay.rs2
-rw-r--r--helix-term/src/ui/picker.rs2
5 files changed, 11 insertions, 11 deletions
diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs
index 39c20950..80da1c54 100644
--- a/helix-term/src/ui/document.rs
+++ b/helix-term/src/ui/document.rs
@@ -118,7 +118,7 @@ pub fn render_document(
fn translate_positions(
char_pos: usize,
- first_visisble_char_idx: usize,
+ first_visible_char_idx: usize,
translated_positions: &mut [TranslatedPosition],
text_fmt: &TextFormat,
renderer: &mut TextRenderer,
@@ -126,7 +126,7 @@ fn translate_positions(
) {
// check if any positions translated on the fly (like cursor) has been reached
for (char_idx, callback) in &mut *translated_positions {
- if *char_idx < char_pos && *char_idx >= first_visisble_char_idx {
+ if *char_idx < char_pos && *char_idx >= first_visible_char_idx {
// by replacing the char_index with usize::MAX large number we ensure
// that the same position is only translated once
// text will never reach usize::MAX as rust memory allocations are limited
@@ -259,7 +259,7 @@ pub fn render_text<'t>(
}
}
- // aquire the correct grapheme style
+ // acquire the correct grapheme style
if char_pos >= style_span.1 {
style_span = styles.next().unwrap_or((Style::default(), usize::MAX));
}
@@ -404,7 +404,7 @@ impl<'a> TextRenderer<'a> {
let cut_off_start = self.col_offset.saturating_sub(position.col);
let is_whitespace = grapheme.is_whitespace();
- // TODO is it correct to apply the whitspace style to all unicode white spaces?
+ // TODO is it correct to apply the whitespace style to all unicode white spaces?
if is_whitespace {
style = style.patch(self.whitespace_style);
}
diff --git a/helix-term/src/ui/fuzzy_match.rs b/helix-term/src/ui/fuzzy_match.rs
index b406702f..22dc3a7f 100644
--- a/helix-term/src/ui/fuzzy_match.rs
+++ b/helix-term/src/ui/fuzzy_match.rs
@@ -54,7 +54,7 @@ impl QueryAtom {
}
fn indices(&self, matcher: &Matcher, item: &str, indices: &mut Vec<usize>) -> bool {
- // for inverse there are no indicies to return
+ // for inverse there are no indices to return
// just return whether we matched
if self.inverse {
return self.matches(matcher, item);
@@ -120,7 +120,7 @@ enum QueryAtomKind {
///
/// Usage: `foo`
Fuzzy,
- /// Item contains query atom as a continous substring
+ /// Item contains query atom as a continuous substring
///
/// Usage `'foo`
Substring,
@@ -213,7 +213,7 @@ impl FuzzyQuery {
Some(score)
}
- pub fn fuzzy_indicies(&self, item: &str, matcher: &Matcher) -> Option<(i64, Vec<usize>)> {
+ pub fn fuzzy_indices(&self, item: &str, matcher: &Matcher) -> Option<(i64, Vec<usize>)> {
let (score, mut indices) = self.first_fuzzy_atom.as_ref().map_or_else(
|| Some((0, Vec::new())),
|atom| matcher.fuzzy_indices(item, atom),
diff --git a/helix-term/src/ui/fuzzy_match/test.rs b/helix-term/src/ui/fuzzy_match/test.rs
index 3f90ef68..5df79eeb 100644
--- a/helix-term/src/ui/fuzzy_match/test.rs
+++ b/helix-term/src/ui/fuzzy_match/test.rs
@@ -7,8 +7,8 @@ fn run_test<'a>(query: &str, items: &'a [&'a str]) -> Vec<String> {
items
.iter()
.filter_map(|item| {
- let (_, indicies) = query.fuzzy_indicies(item, &matcher)?;
- let matched_string = indicies
+ let (_, indices) = query.fuzzy_indices(item, &matcher)?;
+ let matched_string = indices
.iter()
.map(|&pos| item.chars().nth(pos).unwrap())
.collect();
diff --git a/helix-term/src/ui/overlay.rs b/helix-term/src/ui/overlay.rs
index 5b2bc806..ff184d40 100644
--- a/helix-term/src/ui/overlay.rs
+++ b/helix-term/src/ui/overlay.rs
@@ -16,7 +16,7 @@ pub struct Overlay<T> {
}
/// Surrounds the component with a margin of 5% on each side, and an additional 2 rows at the bottom
-pub fn overlayed<T>(content: T) -> Overlay<T> {
+pub fn overlaid<T>(content: T) -> Overlay<T> {
Overlay {
content,
calc_child_size: Box::new(|rect: Rect| clip_rect_relative(rect.clip_bottom(2), 90, 90)),
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index e73088e5..e7a7de90 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -794,7 +794,7 @@ impl<T: Item + 'static> Component for Picker<T> {
// might be inconsistencies. This is the best we can do since only the
// text in Row is displayed to the end user.
let (_score, highlights) = FuzzyQuery::new(self.prompt.line())
- .fuzzy_indicies(&line, &self.matcher)
+ .fuzzy_indices(&line, &self.matcher)
.unwrap_or_default();
let highlight_byte_ranges: Vec<_> = line