aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorDaniel Sedlak2023-04-07 15:10:38 +0000
committerGitHub2023-04-07 15:10:38 +0000
commite856906f766aa6d58aba6f6bca9e2e1879b1629d (patch)
tree59befeebf031ab8de57df97f836bf08ccb7085f2 /helix-term
parent1148ce1fd9941e00bd416bce1f06a987d0e7b5f2 (diff)
Fix typos (#6643)
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/application.rs4
-rw-r--r--helix-term/src/commands.rs22
-rw-r--r--helix-term/src/commands/dap.rs4
-rw-r--r--helix-term/src/commands/lsp.rs26
-rw-r--r--helix-term/src/commands/typed.rs4
-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
-rw-r--r--helix-term/tests/test/movement.rs2
11 files changed, 42 insertions, 42 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 130a74af..f7d7fa63 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -25,7 +25,7 @@ use crate::{
config::Config,
job::Jobs,
keymap::Keymaps,
- ui::{self, overlay::overlayed},
+ ui::{self, overlay::overlaid},
};
use log::{debug, error, warn};
@@ -169,7 +169,7 @@ impl Application {
std::env::set_current_dir(first).context("set current dir")?;
editor.new_file(Action::VerticalSplit);
let picker = ui::file_picker(".".into(), &config.load().editor);
- compositor.push(Box::new(overlayed(picker)));
+ compositor.push(Box::new(overlaid(picker)));
} else {
let nr_of_files = args.files.len();
for (i, (file, pos)) in args.files.into_iter().enumerate() {
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index b55f1ab7..17669924 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -54,7 +54,7 @@ use crate::{
job::Callback,
keymap::ReverseKeymap,
ui::{
- self, editor::InsertEvent, lsp::SignatureHelp, overlay::overlayed, FilePicker, Picker,
+ self, editor::InsertEvent, lsp::SignatureHelp, overlay::overlaid, FilePicker, Picker,
Popup, Prompt, PromptEvent,
},
};
@@ -1561,7 +1561,7 @@ fn half_page_down(cx: &mut Context) {
}
#[allow(deprecated)]
-// currently uses the deprected `visual_coords_at_pos`/`pos_at_visual_coords` functions
+// currently uses the deprecated `visual_coords_at_pos`/`pos_at_visual_coords` functions
// as this function ignores softwrapping (and virtual text) and instead only cares
// about "text visual position"
//
@@ -2147,7 +2147,7 @@ fn global_search(cx: &mut Context) {
Some((path.clone().into(), Some((*line_num, *line_num))))
},
);
- compositor.push(Box::new(overlayed(picker)));
+ compositor.push(Box::new(overlaid(picker)));
},
));
Ok(call)
@@ -2421,7 +2421,7 @@ fn append_mode(cx: &mut Context) {
fn file_picker(cx: &mut Context) {
let root = find_workspace().0;
let picker = ui::file_picker(root, &cx.editor.config());
- cx.push_layer(Box::new(overlayed(picker)));
+ cx.push_layer(Box::new(overlaid(picker)));
}
fn file_picker_in_current_buffer_directory(cx: &mut Context) {
@@ -2438,12 +2438,12 @@ fn file_picker_in_current_buffer_directory(cx: &mut Context) {
};
let picker = ui::file_picker(path, &cx.editor.config());
- cx.push_layer(Box::new(overlayed(picker)));
+ cx.push_layer(Box::new(overlaid(picker)));
}
fn file_picker_in_current_directory(cx: &mut Context) {
let cwd = std::env::current_dir().unwrap_or_else(|_| PathBuf::from("./"));
let picker = ui::file_picker(cwd, &cx.editor.config());
- cx.push_layer(Box::new(overlayed(picker)));
+ cx.push_layer(Box::new(overlaid(picker)));
}
fn buffer_picker(cx: &mut Context) {
@@ -2508,7 +2508,7 @@ fn buffer_picker(cx: &mut Context) {
Some((meta.id.into(), Some((line, line))))
},
);
- cx.push_layer(Box::new(overlayed(picker)));
+ cx.push_layer(Box::new(overlaid(picker)));
}
fn jumplist_picker(cx: &mut Context) {
@@ -2590,7 +2590,7 @@ fn jumplist_picker(cx: &mut Context) {
Some((meta.path.clone()?.into(), Some((line, line))))
},
);
- cx.push_layer(Box::new(overlayed(picker)));
+ cx.push_layer(Box::new(overlaid(picker)));
}
impl ui::menu::Item for MappableCommand {
@@ -2664,7 +2664,7 @@ pub fn command_palette(cx: &mut Context) {
}
}
});
- compositor.push(Box::new(overlayed(picker)));
+ compositor.push(Box::new(overlaid(picker)));
},
));
}
@@ -4185,7 +4185,7 @@ pub fn completion(cx: &mut Context) {
None => return,
};
- // setup a chanel that allows the request to be canceled
+ // setup a channel that allows the request to be canceled
let (tx, rx) = oneshot::channel();
// set completion_request so that this request can be canceled
// by setting completion_request, the old channel stored there is dropped
@@ -4238,7 +4238,7 @@ pub fn completion(cx: &mut Context) {
let (view, doc) = current_ref!(editor);
// check if the completion request is stale.
//
- // Completions are completed asynchrounsly and therefore the user could
+ // Completions are completed asynchronously and therefore the user could
//switch document/view or leave insert mode. In all of thoise cases the
// completion should be discarded
if editor.mode != Mode::Insert || view.id != trigger_view || doc.id() != trigger_doc {
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index dac1e9d5..8efdc9cf 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -2,7 +2,7 @@ use super::{Context, Editor};
use crate::{
compositor::{self, Compositor},
job::{Callback, Jobs},
- ui::{self, overlay::overlayed, FilePicker, Picker, Popup, Prompt, PromptEvent, Text},
+ ui::{self, overlay::overlaid, FilePicker, Picker, Popup, Prompt, PromptEvent, Text},
};
use dap::{StackFrame, Thread, ThreadStates};
use helix_core::syntax::{DebugArgumentValue, DebugConfigCompletion, DebugTemplate};
@@ -270,7 +270,7 @@ pub fn dap_launch(cx: &mut Context) {
let templates = config.templates.clone();
- cx.push_layer(Box::new(overlayed(Picker::new(
+ cx.push_layer(Box::new(overlaid(Picker::new(
templates,
(),
|cx, template, _action| {
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index 78dbc0be..7a26b3cf 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -26,7 +26,7 @@ use helix_view::{
use crate::{
compositor::{self, Compositor},
ui::{
- self, lsp::SignatureHelp, overlay::overlayed, DynamicPicker, FileLocation, FilePicker,
+ self, lsp::SignatureHelp, overlay::overlaid, DynamicPicker, FileLocation, FilePicker,
Popup, PromptEvent,
},
};
@@ -372,7 +372,7 @@ pub fn symbol_picker(cx: &mut Context) {
};
let picker = sym_picker(symbols, current_url, offset_encoding);
- compositor.push(Box::new(overlayed(picker)))
+ compositor.push(Box::new(overlaid(picker)))
}
},
)
@@ -431,7 +431,7 @@ pub fn workspace_symbol_picker(cx: &mut Context) {
future.boxed()
};
let dyn_picker = DynamicPicker::new(picker, Box::new(get_symbols));
- compositor.push(Box::new(overlayed(dyn_picker)))
+ compositor.push(Box::new(overlaid(dyn_picker)))
},
)
}
@@ -454,7 +454,7 @@ pub fn diagnostics_picker(cx: &mut Context) {
DiagnosticsFormat::HideSourcePath,
offset_encoding,
);
- cx.push_layer(Box::new(overlayed(picker)));
+ cx.push_layer(Box::new(overlaid(picker)));
}
}
@@ -471,7 +471,7 @@ pub fn workspace_diagnostics_picker(cx: &mut Context) {
DiagnosticsFormat::ShowSourcePath,
offset_encoding,
);
- cx.push_layer(Box::new(overlayed(picker)));
+ cx.push_layer(Box::new(overlaid(picker)));
}
impl ui::menu::Item for lsp::CodeActionOrCommand {
@@ -491,7 +491,7 @@ impl ui::menu::Item for lsp::CodeActionOrCommand {
///
/// While the `kind` field is defined as open ended in the LSP spec (any value may be used)
/// in practice a closed set of common values (mostly suggested in the LSP spec) are used.
-/// VSCode displays each of these categories seperatly (seperated by a heading in the codeactions picker)
+/// VSCode displays each of these categories separately (separated by a heading in the codeactions picker)
/// to make them easier to navigate. Helix does not display these headings to the user.
/// However it does sort code actions by their categories to achieve the same order as the VScode picker,
/// just without the headings.
@@ -521,7 +521,7 @@ fn action_category(action: &CodeActionOrCommand) -> u32 {
}
}
-fn action_prefered(action: &CodeActionOrCommand) -> bool {
+fn action_preferred(action: &CodeActionOrCommand) -> bool {
matches!(
action,
CodeActionOrCommand::CodeAction(CodeAction {
@@ -600,12 +600,12 @@ pub fn code_action(cx: &mut Context) {
}
// Sort codeactions into a useful order. This behaviour is only partially described in the LSP spec.
- // Many details are modeled after vscode because langauge servers are usually tested against it.
+ // Many details are modeled after vscode because language servers are usually tested against it.
// VScode sorts the codeaction two times:
//
// First the codeactions that fix some diagnostics are moved to the front.
// If both codeactions fix some diagnostics (or both fix none) the codeaction
- // that is marked with `is_preffered` is shown first. The codeactions are then shown in seperate
+ // that is marked with `is_preferred` is shown first. The codeactions are then shown in separate
// submenus that only contain a certain category (see `action_category`) of actions.
//
// Below this done in in a single sorting step
@@ -627,10 +627,10 @@ pub fn code_action(cx: &mut Context) {
return order;
}
- // if one of the codeactions is marked as prefered show it first
+ // if one of the codeactions is marked as preferred show it first
// otherwise keep the original LSP sorting
- action_prefered(action1)
- .cmp(&action_prefered(action2))
+ action_preferred(action1)
+ .cmp(&action_preferred(action2))
.reverse()
});
@@ -955,7 +955,7 @@ fn goto_impl(
},
move |_editor, location| Some(location_to_file_location(location)),
);
- compositor.push(Box::new(overlayed(picker)));
+ compositor.push(Box::new(overlaid(picker)));
}
}
}
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index afc3d706..3c954d20 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -116,7 +116,7 @@ fn open(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
let call: job::Callback = job::Callback::EditorCompositor(Box::new(
move |editor: &mut Editor, compositor: &mut Compositor| {
let picker = ui::file_picker(path, &editor.config());
- compositor.push(Box::new(overlayed(picker)));
+ compositor.push(Box::new(overlaid(picker)));
},
));
Ok(call)
@@ -1335,7 +1335,7 @@ fn lsp_workspace_command(
let picker = ui::Picker::new(commands, (), |cx, command, _action| {
execute_lsp_command(cx.editor, command.clone());
});
- compositor.push(Box::new(overlayed(picker)))
+ compositor.push(Box::new(overlaid(picker)))
},
));
Ok(call)
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
diff --git a/helix-term/tests/test/movement.rs b/helix-term/tests/test/movement.rs
index e10ec6f5..9a48cdbc 100644
--- a/helix-term/tests/test/movement.rs
+++ b/helix-term/tests/test/movement.rs
@@ -391,7 +391,7 @@ async fn cursor_position_newly_opened_file() -> anyhow::Result<()> {
#[tokio::test(flavor = "multi_thread")]
async fn cursor_position_append_eof() -> anyhow::Result<()> {
- // Selection is fowards
+ // Selection is forwards
test((
"#[foo|]#",
"abar<esc>",