on master help sign in
Fix typos (#6643)
e856906Daniel Sedlak
helix-core/src/position.rs+2−2
@@ -109,7 +109,7 @@ pub fn visual_coords_at_pos(text: RopeSlice, pos: usize, tab_width: usize) -> Po
109/// softwrapping positions are estimated with an O(1) algorithm
109/// softwrapping positions are estimated with an O(1) algorithm
110/// to ensure consistent performance for large lines (currently unimplemented)
110/// to ensure consistent performance for large lines (currently unimplemented)
111///
111///
112−/// Usualy you want to use `visual_offset_from_anchor` instead but this function
112+/// Usually you want to use `visual_offset_from_anchor` instead but this function
113/// can be useful (and faster) if
113/// can be useful (and faster) if
114/// * You already know the visual position of the block
114/// * You already know the visual position of the block
115/// * You only care about the horizontal offset (column) and not the vertical offset (row)
115/// * You only care about the horizontal offset (column) and not the vertical offset (row)
@@ -291,7 +291,7 @@ pub fn pos_at_visual_coords(text: RopeSlice, coords: Position, tab_width: usize)
291///
291///
292/// If no (text) grapheme starts at exactly at the specified column the
292/// If no (text) grapheme starts at exactly at the specified column the
293/// start of the grapheme to the left is returned. If there is no grapheme
293/// start of the grapheme to the left is returned. If there is no grapheme
294−/// to the left (for example if the line starts with virtual text) then the positiong
294+/// to the left (for example if the line starts with virtual text) then the positioning
295/// of the next grapheme to the right is returned.
295/// of the next grapheme to the right is returned.
296///
296///
297/// If the `line` coordinate is beyond the end of the file, the EOF
297/// If the `line` coordinate is beyond the end of the file, the EOF
helix-core/src/selection.rs+1−1
@@ -38,7 +38,7 @@ use std::borrow::Cow;
38/// Ranges are considered to be inclusive on the left and
38/// Ranges are considered to be inclusive on the left and
39/// exclusive on the right, regardless of anchor-head ordering.
39/// exclusive on the right, regardless of anchor-head ordering.
40/// This means, for example, that non-zero-width ranges that
40/// This means, for example, that non-zero-width ranges that
41−/// are directly adjecent, sharing an edge, do not overlap.
41+/// are directly adjacent, sharing an edge, do not overlap.
42/// However, a zero-width range will overlap with the shared
42/// However, a zero-width range will overlap with the shared
43/// left-edge of another range.
43/// left-edge of another range.
44///
44///
helix-core/src/shellwords.rs+2−2
@@ -294,14 +294,14 @@ mod test {
294 #[test]
294 #[test]
295 fn test_lists() {
295 fn test_lists() {
296 let input =
296 let input =
297− r#":set statusline.center ["file-type","file-encoding"] '["list", "in", "qoutes"]'"#;
297+ r#":set statusline.center ["file-type","file-encoding"] '["list", "in", "quotes"]'"#;
298 let shellwords = Shellwords::from(input);
298 let shellwords = Shellwords::from(input);
299 let result = shellwords.words().to_vec();
299 let result = shellwords.words().to_vec();
300 let expected = vec![
300 let expected = vec![
301 Cow::from(":set"),
301 Cow::from(":set"),
302 Cow::from("statusline.center"),
302 Cow::from("statusline.center"),
303 Cow::from(r#"["file-type","file-encoding"]"#),
303 Cow::from(r#"["file-type","file-encoding"]"#),
304− Cow::from(r#"["list", "in", "qoutes"]"#),
304+ Cow::from(r#"["list", "in", "quotes"]"#),
305 ];
305 ];
306 assert_eq!(expected, result);
306 assert_eq!(expected, result);
307 }
307 }
helix-core/src/text_annotations.rs+2−2
@@ -172,7 +172,7 @@ impl TextAnnotations {
172 for char_idx in char_range {
172 for char_idx in char_range {
173 if let Some((_, Some(highlight))) = self.overlay_at(char_idx) {
173 if let Some((_, Some(highlight))) = self.overlay_at(char_idx) {
174 // we don't know the number of chars the original grapheme takes
174 // we don't know the number of chars the original grapheme takes
175− // however it doesn't matter as highlight bounderies are automatically
175+ // however it doesn't matter as highlight boundaries are automatically
176 // aligned to grapheme boundaries in the rendering code
176 // aligned to grapheme boundaries in the rendering code
177 highlights.push((highlight.0, char_idx..char_idx + 1))
177 highlights.push((highlight.0, char_idx..char_idx + 1))
178 }
178 }
@@ -203,7 +203,7 @@ impl TextAnnotations {
203
203
204 /// Add new grapheme overlays.
204 /// Add new grapheme overlays.
205 ///
205 ///
206− /// The overlayed grapheme will be rendered with `highlight`
206+ /// The overlaid grapheme will be rendered with `highlight`
207 /// patched on top of `ui.text`.
207 /// patched on top of `ui.text`.
208 ///
208 ///
209 /// The overlays **must be sorted** by their `char_idx`.
209 /// The overlays **must be sorted** by their `char_idx`.
helix-lsp/src/client.rs+7−7
@@ -52,8 +52,8 @@ pub struct Client {
52 root_path: std::path::PathBuf,
52 root_path: std::path::PathBuf,
53 root_uri: Option<lsp::Url>,
53 root_uri: Option<lsp::Url>,
54 workspace_folders: Mutex<Vec<lsp::WorkspaceFolder>>,
54 workspace_folders: Mutex<Vec<lsp::WorkspaceFolder>>,
55− initalize_notify: Arc<Notify>,
55+ initialize_notify: Arc<Notify>,
56− /// workspace folders added while the server is still initalizing
56+ /// workspace folders added while the server is still initializing
57 req_timeout: u64,
57 req_timeout: u64,
58}
58}
59
59
@@ -92,14 +92,14 @@ impl Client {
92 return true;
92 return true;
93 }
93 }
94
94
95− // this server definitly doesn't support multiple workspace, no need to check capabilities
95+ // this server definitely doesn't support multiple workspace, no need to check capabilities
96 if !may_support_workspace {
96 if !may_support_workspace {
97 return false;
97 return false;
98 }
98 }
99
99
100 let Some(capabilities) = self.capabilities.get() else {
100 let Some(capabilities) = self.capabilities.get() else {
101 let client = Arc::clone(self);
101 let client = Arc::clone(self);
102− // initalization hasn't finished yet, deal with this new root later
102+ // initialization hasn't finished yet, deal with this new root later
103 // TODO: In the edgecase that a **new root** is added
103 // TODO: In the edgecase that a **new root** is added
104 // for an LSP that **doesn't support workspace_folders** before initaliation is finished
104 // for an LSP that **doesn't support workspace_folders** before initaliation is finished
105 // the new roots are ignored.
105 // the new roots are ignored.
@@ -108,7 +108,7 @@ impl Client {
108 // documents LSP client handle. It's doable but a pretty weird edgecase so let's
108 // documents LSP client handle. It's doable but a pretty weird edgecase so let's
109 // wait and see if anyone ever runs into it.
109 // wait and see if anyone ever runs into it.
110 tokio::spawn(async move {
110 tokio::spawn(async move {
111− client.initalize_notify.notified().await;
111+ client.initialize_notify.notified().await;
112 if let Some(workspace_folders_caps) = client
112 if let Some(workspace_folders_caps) = client
113 .capabilities()
113 .capabilities()
114 .workspace
114 .workspace
@@ -234,7 +234,7 @@ impl Client {
234 root_path,
234 root_path,
235 root_uri,
235 root_uri,
236 workspace_folders: Mutex::new(workspace_folders),
236 workspace_folders: Mutex::new(workspace_folders),
237− initalize_notify: initialize_notify.clone(),
237+ initialize_notify: initialize_notify.clone(),
238 };
238 };
239
239
240 Ok((client, server_rx, initialize_notify))
240 Ok((client, server_rx, initialize_notify))
@@ -279,7 +279,7 @@ impl Client {
279 "utf-16" => Some(OffsetEncoding::Utf16),
279 "utf-16" => Some(OffsetEncoding::Utf16),
280 "utf-32" => Some(OffsetEncoding::Utf32),
280 "utf-32" => Some(OffsetEncoding::Utf32),
281 encoding => {
281 encoding => {
282− log::error!("Server provided invalid position encording {encoding}, defaulting to utf-16");
282+ log::error!("Server provided invalid position encoding {encoding}, defaulting to utf-16");
283 None
283 None
284 },
284 },
285 })
285 })
helix-lsp/src/lib.rs+3−3
@@ -152,10 +152,10 @@ pub mod util {
152 // > ‘\n’, ‘\r\n’ and ‘\r’. Positions are line end character agnostic.
152 // > ‘\n’, ‘\r\n’ and ‘\r’. Positions are line end character agnostic.
153 // > So you can not specify a position that denotes \r|\n or \n| where | represents the character offset.
153 // > So you can not specify a position that denotes \r|\n or \n| where | represents the character offset.
154 //
154 //
155− // This means that while the line must be in bounds the `charater`
155+ // This means that while the line must be in bounds the `character`
156 // must be capped to the end of the line.
156 // must be capped to the end of the line.
157 // Note that the end of the line here is **before** the line terminator
157 // Note that the end of the line here is **before** the line terminator
158− // so we must use `line_end_char_index` istead of `doc.line_to_char(pos_line + 1)`
158+ // so we must use `line_end_char_index` instead of `doc.line_to_char(pos_line + 1)`
159 //
159 //
160 // FIXME: Helix does not fully comply with the LSP spec for line terminators.
160 // FIXME: Helix does not fully comply with the LSP spec for line terminators.
161 // The LSP standard requires that line terminators are ['\n', '\r\n', '\r'].
161 // The LSP standard requires that line terminators are ['\n', '\r\n', '\r'].
@@ -893,7 +893,7 @@ fn start_client(
893/// * if the file is outside `workspace` return `None`
893/// * if the file is outside `workspace` return `None`
894/// * start at `file` and search the file tree upward
894/// * start at `file` and search the file tree upward
895/// * stop the search at the first `root_dirs` entry that contains `file`
895/// * stop the search at the first `root_dirs` entry that contains `file`
896−/// * if no `root_dirs` matchs `file` stop at workspace
896+/// * if no `root_dirs` matches `file` stop at workspace
897/// * Returns the top most directory that contains a `root_marker`
897/// * Returns the top most directory that contains a `root_marker`
898/// * If no root marker and we stopped at a `root_dirs` entry, return the directory we stopped at
898/// * If no root marker and we stopped at a `root_dirs` entry, return the directory we stopped at
899/// * If we stopped at `workspace` instead and `workspace_is_cwd == false` return `None`
899/// * If we stopped at `workspace` instead and `workspace_is_cwd == false` return `None`
helix-lsp/src/snippet.rs+6−6
@@ -61,7 +61,7 @@ fn render_elements(
61 offset: &mut usize,
61 offset: &mut usize,
62 tabstops: &mut Vec<(usize, (usize, usize))>,
62 tabstops: &mut Vec<(usize, (usize, usize))>,
63 newline_with_offset: &str,
63 newline_with_offset: &str,
64− include_placeholer: bool,
64+ include_placeholder: bool,
65) {
65) {
66 use SnippetElement::*;
66 use SnippetElement::*;
67
67
@@ -89,7 +89,7 @@ fn render_elements(
89 offset,
89 offset,
90 tabstops,
90 tabstops,
91 newline_with_offset,
91 newline_with_offset,
92− include_placeholer,
92+ include_placeholder,
93 );
93 );
94 }
94 }
95 &Tabstop { tabstop } => {
95 &Tabstop { tabstop } => {
@@ -100,14 +100,14 @@ fn render_elements(
100 value: inner_snippet_elements,
100 value: inner_snippet_elements,
101 } => {
101 } => {
102 let start_offset = *offset;
102 let start_offset = *offset;
103− if include_placeholer {
103+ if include_placeholder {
104 render_elements(
104 render_elements(
105 inner_snippet_elements,
105 inner_snippet_elements,
106 insert,
106 insert,
107 offset,
107 offset,
108 tabstops,
108 tabstops,
109 newline_with_offset,
109 newline_with_offset,
110− include_placeholer,
110+ include_placeholder,
111 );
111 );
112 }
112 }
113 tabstops.push((*tabstop, (start_offset, *offset)));
113 tabstops.push((*tabstop, (start_offset, *offset)));
@@ -127,7 +127,7 @@ fn render_elements(
127pub fn render(
127pub fn render(
128 snippet: &Snippet<'_>,
128 snippet: &Snippet<'_>,
129 newline_with_offset: &str,
129 newline_with_offset: &str,
130− include_placeholer: bool,
130+ include_placeholder: bool,
131) -> (Tendril, Vec<SmallVec<[(usize, usize); 1]>>) {
131) -> (Tendril, Vec<SmallVec<[(usize, usize); 1]>>) {
132 let mut insert = Tendril::new();
132 let mut insert = Tendril::new();
133 let mut tabstops = Vec::new();
133 let mut tabstops = Vec::new();
@@ -139,7 +139,7 @@ pub fn render(
139 &mut offset,
139 &mut offset,
140 &mut tabstops,
140 &mut tabstops,
141 newline_with_offset,
141 newline_with_offset,
142− include_placeholer,
142+ include_placeholder,
143 );
143 );
144
144
145 // sort in ascending order (except for 0, which should always be the last one (per lsp doc))
145 // sort in ascending order (except for 0, which should always be the last one (per lsp doc))
helix-term/src/application.rs+2−2
@@ -25,7 +25,7 @@ use crate::{
25 config::Config,
25 config::Config,
26 job::Jobs,
26 job::Jobs,
27 keymap::Keymaps,
27 keymap::Keymaps,
28− ui::{self, overlay::overlayed},
28+ ui::{self, overlay::overlaid},
29};
29};
30
30
31use log::{debug, error, warn};
31use log::{debug, error, warn};
@@ -169,7 +169,7 @@ impl Application {
169 std::env::set_current_dir(first).context("set current dir")?;
169 std::env::set_current_dir(first).context("set current dir")?;
170 editor.new_file(Action::VerticalSplit);
170 editor.new_file(Action::VerticalSplit);
171 let picker = ui::file_picker(".".into(), &config.load().editor);
171 let picker = ui::file_picker(".".into(), &config.load().editor);
172− compositor.push(Box::new(overlayed(picker)));
172+ compositor.push(Box::new(overlaid(picker)));
173 } else {
173 } else {
174 let nr_of_files = args.files.len();
174 let nr_of_files = args.files.len();
175 for (i, (file, pos)) in args.files.into_iter().enumerate() {
175 for (i, (file, pos)) in args.files.into_iter().enumerate() {
helix-term/src/commands.rs+11−11
@@ -54,7 +54,7 @@ use crate::{
54 job::Callback,
54 job::Callback,
55 keymap::ReverseKeymap,
55 keymap::ReverseKeymap,
56 ui::{
56 ui::{
57− self, editor::InsertEvent, lsp::SignatureHelp, overlay::overlayed, FilePicker, Picker,
57+ self, editor::InsertEvent, lsp::SignatureHelp, overlay::overlaid, FilePicker, Picker,
58 Popup, Prompt, PromptEvent,
58 Popup, Prompt, PromptEvent,
59 },
59 },
60};
60};
@@ -1561,7 +1561,7 @@ fn half_page_down(cx: &mut Context) {
1561}
1561}
1562
1562
1563#[allow(deprecated)]
1563#[allow(deprecated)]
1564−// currently uses the deprected `visual_coords_at_pos`/`pos_at_visual_coords` functions
1564+// currently uses the deprecated `visual_coords_at_pos`/`pos_at_visual_coords` functions
1565// as this function ignores softwrapping (and virtual text) and instead only cares
1565// as this function ignores softwrapping (and virtual text) and instead only cares
1566// about "text visual position"
1566// about "text visual position"
1567//
1567//
@@ -2147,7 +2147,7 @@ fn global_search(cx: &mut Context) {
2147 Some((path.clone().into(), Some((*line_num, *line_num))))
2147 Some((path.clone().into(), Some((*line_num, *line_num))))
2148 },
2148 },
2149 );
2149 );
2150− compositor.push(Box::new(overlayed(picker)));
2150+ compositor.push(Box::new(overlaid(picker)));
2151 },
2151 },
2152 ));
2152 ));
2153 Ok(call)
2153 Ok(call)
@@ -2421,7 +2421,7 @@ fn append_mode(cx: &mut Context) {
2421fn file_picker(cx: &mut Context) {
2421fn file_picker(cx: &mut Context) {
2422 let root = find_workspace().0;
2422 let root = find_workspace().0;
2423 let picker = ui::file_picker(root, &cx.editor.config());
2423 let picker = ui::file_picker(root, &cx.editor.config());
2424− cx.push_layer(Box::new(overlayed(picker)));
2424+ cx.push_layer(Box::new(overlaid(picker)));
2425}
2425}
2426
2426
2427fn file_picker_in_current_buffer_directory(cx: &mut Context) {
2427fn file_picker_in_current_buffer_directory(cx: &mut Context) {
@@ -2438,12 +2438,12 @@ fn file_picker_in_current_buffer_directory(cx: &mut Context) {
2438 };
2438 };
2439
2439
2440 let picker = ui::file_picker(path, &cx.editor.config());
2440 let picker = ui::file_picker(path, &cx.editor.config());
2441− cx.push_layer(Box::new(overlayed(picker)));
2441+ cx.push_layer(Box::new(overlaid(picker)));
2442}
2442}
2443fn file_picker_in_current_directory(cx: &mut Context) {
2443fn file_picker_in_current_directory(cx: &mut Context) {
2444 let cwd = std::env::current_dir().unwrap_or_else(|_| PathBuf::from("./"));
2444 let cwd = std::env::current_dir().unwrap_or_else(|_| PathBuf::from("./"));
2445 let picker = ui::file_picker(cwd, &cx.editor.config());
2445 let picker = ui::file_picker(cwd, &cx.editor.config());
2446− cx.push_layer(Box::new(overlayed(picker)));
2446+ cx.push_layer(Box::new(overlaid(picker)));
2447}
2447}
2448
2448
2449fn buffer_picker(cx: &mut Context) {
2449fn buffer_picker(cx: &mut Context) {
@@ -2508,7 +2508,7 @@ fn buffer_picker(cx: &mut Context) {
2508 Some((meta.id.into(), Some((line, line))))
2508 Some((meta.id.into(), Some((line, line))))
2509 },
2509 },
2510 );
2510 );
2511− cx.push_layer(Box::new(overlayed(picker)));
2511+ cx.push_layer(Box::new(overlaid(picker)));
2512}
2512}
2513
2513
2514fn jumplist_picker(cx: &mut Context) {
2514fn jumplist_picker(cx: &mut Context) {
@@ -2590,7 +2590,7 @@ fn jumplist_picker(cx: &mut Context) {
2590 Some((meta.path.clone()?.into(), Some((line, line))))
2590 Some((meta.path.clone()?.into(), Some((line, line))))
2591 },
2591 },
2592 );
2592 );
2593− cx.push_layer(Box::new(overlayed(picker)));
2593+ cx.push_layer(Box::new(overlaid(picker)));
2594}
2594}
2595
2595
2596impl ui::menu::Item for MappableCommand {
2596impl ui::menu::Item for MappableCommand {
@@ -2664,7 +2664,7 @@ pub fn command_palette(cx: &mut Context) {
2664 }
2664 }
2665 }
2665 }
2666 });
2666 });
2667− compositor.push(Box::new(overlayed(picker)));
2667+ compositor.push(Box::new(overlaid(picker)));
2668 },
2668 },
2669 ));
2669 ));
2670}
2670}
@@ -4185,7 +4185,7 @@ pub fn completion(cx: &mut Context) {
4185 None => return,
4185 None => return,
4186 };
4186 };
4187
4187
4188− // setup a chanel that allows the request to be canceled
4188+ // setup a channel that allows the request to be canceled
4189 let (tx, rx) = oneshot::channel();
4189 let (tx, rx) = oneshot::channel();
4190 // set completion_request so that this request can be canceled
4190 // set completion_request so that this request can be canceled
4191 // by setting completion_request, the old channel stored there is dropped
4191 // by setting completion_request, the old channel stored there is dropped
@@ -4238,7 +4238,7 @@ pub fn completion(cx: &mut Context) {
4238 let (view, doc) = current_ref!(editor);
4238 let (view, doc) = current_ref!(editor);
4239 // check if the completion request is stale.
4239 // check if the completion request is stale.
4240 //
4240 //
4241− // Completions are completed asynchrounsly and therefore the user could
4241+ // Completions are completed asynchronously and therefore the user could
4242 //switch document/view or leave insert mode. In all of thoise cases the
4242 //switch document/view or leave insert mode. In all of thoise cases the
4243 // completion should be discarded
4243 // completion should be discarded
4244 if editor.mode != Mode::Insert || view.id != trigger_view || doc.id() != trigger_doc {
4244 if editor.mode != Mode::Insert || view.id != trigger_view || doc.id() != trigger_doc {
helix-term/src/commands/dap.rs+2−2
@@ -2,7 +2,7 @@ use super::{Context, Editor};
2use crate::{
2use crate::{
3 compositor::{self, Compositor},
3 compositor::{self, Compositor},
4 job::{Callback, Jobs},
4 job::{Callback, Jobs},
5− ui::{self, overlay::overlayed, FilePicker, Picker, Popup, Prompt, PromptEvent, Text},
5+ ui::{self, overlay::overlaid, FilePicker, Picker, Popup, Prompt, PromptEvent, Text},
6};
6};
7use dap::{StackFrame, Thread, ThreadStates};
7use dap::{StackFrame, Thread, ThreadStates};
8use helix_core::syntax::{DebugArgumentValue, DebugConfigCompletion, DebugTemplate};
8use helix_core::syntax::{DebugArgumentValue, DebugConfigCompletion, DebugTemplate};
@@ -270,7 +270,7 @@ pub fn dap_launch(cx: &mut Context) {
270
270
271 let templates = config.templates.clone();
271 let templates = config.templates.clone();
272
272
273− cx.push_layer(Box::new(overlayed(Picker::new(
273+ cx.push_layer(Box::new(overlaid(Picker::new(
274 templates,
274 templates,
275 (),
275 (),
276 |cx, template, _action| {
276 |cx, template, _action| {
helix-term/src/commands/lsp.rs+13−13
@@ -26,7 +26,7 @@ use helix_view::{
26use crate::{
26use crate::{
27 compositor::{self, Compositor},
27 compositor::{self, Compositor},
28 ui::{
28 ui::{
29− self, lsp::SignatureHelp, overlay::overlayed, DynamicPicker, FileLocation, FilePicker,
29+ self, lsp::SignatureHelp, overlay::overlaid, DynamicPicker, FileLocation, FilePicker,
30 Popup, PromptEvent,
30 Popup, PromptEvent,
31 },
31 },
32};
32};
@@ -372,7 +372,7 @@ pub fn symbol_picker(cx: &mut Context) {
372 };
372 };
373
373
374 let picker = sym_picker(symbols, current_url, offset_encoding);
374 let picker = sym_picker(symbols, current_url, offset_encoding);
375− compositor.push(Box::new(overlayed(picker)))
375+ compositor.push(Box::new(overlaid(picker)))
376 }
376 }
377 },
377 },
378 )
378 )
@@ -431,7 +431,7 @@ pub fn workspace_symbol_picker(cx: &mut Context) {
431 future.boxed()
431 future.boxed()
432 };
432 };
433 let dyn_picker = DynamicPicker::new(picker, Box::new(get_symbols));
433 let dyn_picker = DynamicPicker::new(picker, Box::new(get_symbols));
434− compositor.push(Box::new(overlayed(dyn_picker)))
434+ compositor.push(Box::new(overlaid(dyn_picker)))
435 },
435 },
436 )
436 )
437}
437}
@@ -454,7 +454,7 @@ pub fn diagnostics_picker(cx: &mut Context) {
454 DiagnosticsFormat::HideSourcePath,
454 DiagnosticsFormat::HideSourcePath,
455 offset_encoding,
455 offset_encoding,
456 );
456 );
457− cx.push_layer(Box::new(overlayed(picker)));
457+ cx.push_layer(Box::new(overlaid(picker)));
458 }
458 }
459}
459}
460
460
@@ -471,7 +471,7 @@ pub fn workspace_diagnostics_picker(cx: &mut Context) {
471 DiagnosticsFormat::ShowSourcePath,
471 DiagnosticsFormat::ShowSourcePath,
472 offset_encoding,
472 offset_encoding,
473 );
473 );
474− cx.push_layer(Box::new(overlayed(picker)));
474+ cx.push_layer(Box::new(overlaid(picker)));
475}
475}
476
476
477impl ui::menu::Item for lsp::CodeActionOrCommand {
477impl ui::menu::Item for lsp::CodeActionOrCommand {
@@ -491,7 +491,7 @@ impl ui::menu::Item for lsp::CodeActionOrCommand {
491///
491///
492/// While the `kind` field is defined as open ended in the LSP spec (any value may be used)
492/// While the `kind` field is defined as open ended in the LSP spec (any value may be used)
493/// in practice a closed set of common values (mostly suggested in the LSP spec) are used.
493/// in practice a closed set of common values (mostly suggested in the LSP spec) are used.
494−/// VSCode displays each of these categories seperatly (seperated by a heading in the codeactions picker)
494+/// VSCode displays each of these categories separately (separated by a heading in the codeactions picker)
495/// to make them easier to navigate. Helix does not display these headings to the user.
495/// to make them easier to navigate. Helix does not display these headings to the user.
496/// However it does sort code actions by their categories to achieve the same order as the VScode picker,
496/// However it does sort code actions by their categories to achieve the same order as the VScode picker,
497/// just without the headings.
497/// just without the headings.
@@ -521,7 +521,7 @@ fn action_category(action: &CodeActionOrCommand) -> u32 {
521 }
521 }
522}
522}
523
523
524−fn action_prefered(action: &CodeActionOrCommand) -> bool {
524+fn action_preferred(action: &CodeActionOrCommand) -> bool {
525 matches!(
525 matches!(
526 action,
526 action,
527 CodeActionOrCommand::CodeAction(CodeAction {
527 CodeActionOrCommand::CodeAction(CodeAction {
@@ -600,12 +600,12 @@ pub fn code_action(cx: &mut Context) {
600 }
600 }
601
601
602 // Sort codeactions into a useful order. This behaviour is only partially described in the LSP spec.
602 // Sort codeactions into a useful order. This behaviour is only partially described in the LSP spec.
603− // Many details are modeled after vscode because langauge servers are usually tested against it.
603+ // Many details are modeled after vscode because language servers are usually tested against it.
604 // VScode sorts the codeaction two times:
604 // VScode sorts the codeaction two times:
605 //
605 //
606 // First the codeactions that fix some diagnostics are moved to the front.
606 // First the codeactions that fix some diagnostics are moved to the front.
607 // If both codeactions fix some diagnostics (or both fix none) the codeaction
607 // If both codeactions fix some diagnostics (or both fix none) the codeaction
608− // that is marked with `is_preffered` is shown first. The codeactions are then shown in seperate
608+ // that is marked with `is_preferred` is shown first. The codeactions are then shown in separate
609 // submenus that only contain a certain category (see `action_category`) of actions.
609 // submenus that only contain a certain category (see `action_category`) of actions.
610 //
610 //
611 // Below this done in in a single sorting step
611 // Below this done in in a single sorting step
@@ -627,10 +627,10 @@ pub fn code_action(cx: &mut Context) {
627 return order;
627 return order;
628 }
628 }
629
629
630− // if one of the codeactions is marked as prefered show it first
630+ // if one of the codeactions is marked as preferred show it first
631 // otherwise keep the original LSP sorting
631 // otherwise keep the original LSP sorting
632− action_prefered(action1)
632+ action_preferred(action1)
633− .cmp(&action_prefered(action2))
633+ .cmp(&action_preferred(action2))
634 .reverse()
634 .reverse()
635 });
635 });
636
636
@@ -955,7 +955,7 @@ fn goto_impl(
955 },
955 },
956 move |_editor, location| Some(location_to_file_location(location)),
956 move |_editor, location| Some(location_to_file_location(location)),
957 );
957 );
958− compositor.push(Box::new(overlayed(picker)));
958+ compositor.push(Box::new(overlaid(picker)));
959 }
959 }
960 }
960 }
961}
961}
helix-term/src/commands/typed.rs+2−2
@@ -116,7 +116,7 @@ fn open(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
116 let call: job::Callback = job::Callback::EditorCompositor(Box::new(
116 let call: job::Callback = job::Callback::EditorCompositor(Box::new(
117 move |editor: &mut Editor, compositor: &mut Compositor| {
117 move |editor: &mut Editor, compositor: &mut Compositor| {
118 let picker = ui::file_picker(path, &editor.config());
118 let picker = ui::file_picker(path, &editor.config());
119− compositor.push(Box::new(overlayed(picker)));
119+ compositor.push(Box::new(overlaid(picker)));
120 },
120 },
121 ));
121 ));
122 Ok(call)
122 Ok(call)
@@ -1335,7 +1335,7 @@ fn lsp_workspace_command(
1335 let picker = ui::Picker::new(commands, (), |cx, command, _action| {
1335 let picker = ui::Picker::new(commands, (), |cx, command, _action| {
1336 execute_lsp_command(cx.editor, command.clone());
1336 execute_lsp_command(cx.editor, command.clone());
1337 });
1337 });
1338− compositor.push(Box::new(overlayed(picker)))
1338+ compositor.push(Box::new(overlaid(picker)))
1339 },
1339 },
1340 ));
1340 ));
1341 Ok(call)
1341 Ok(call)
helix-term/src/ui/document.rs+4−4
@@ -118,7 +118,7 @@ pub fn render_document(
118
118
119fn translate_positions(
119fn translate_positions(
120 char_pos: usize,
120 char_pos: usize,
121− first_visisble_char_idx: usize,
121+ first_visible_char_idx: usize,
122 translated_positions: &mut [TranslatedPosition],
122 translated_positions: &mut [TranslatedPosition],
123 text_fmt: &TextFormat,
123 text_fmt: &TextFormat,
124 renderer: &mut TextRenderer,
124 renderer: &mut TextRenderer,
@@ -126,7 +126,7 @@ fn translate_positions(
126) {
126) {
127 // check if any positions translated on the fly (like cursor) has been reached
127 // check if any positions translated on the fly (like cursor) has been reached
128 for (char_idx, callback) in &mut *translated_positions {
128 for (char_idx, callback) in &mut *translated_positions {
129− if *char_idx < char_pos && *char_idx >= first_visisble_char_idx {
129+ if *char_idx < char_pos && *char_idx >= first_visible_char_idx {
130 // by replacing the char_index with usize::MAX large number we ensure
130 // by replacing the char_index with usize::MAX large number we ensure
131 // that the same position is only translated once
131 // that the same position is only translated once
132 // text will never reach usize::MAX as rust memory allocations are limited
132 // text will never reach usize::MAX as rust memory allocations are limited
@@ -259,7 +259,7 @@ pub fn render_text<'t>(
259 }
259 }
260 }
260 }
261
261
262− // aquire the correct grapheme style
262+ // acquire the correct grapheme style
263 if char_pos >= style_span.1 {
263 if char_pos >= style_span.1 {
264 style_span = styles.next().unwrap_or((Style::default(), usize::MAX));
264 style_span = styles.next().unwrap_or((Style::default(), usize::MAX));
265 }
265 }
@@ -404,7 +404,7 @@ impl<'a> TextRenderer<'a> {
404 let cut_off_start = self.col_offset.saturating_sub(position.col);
404 let cut_off_start = self.col_offset.saturating_sub(position.col);
405 let is_whitespace = grapheme.is_whitespace();
405 let is_whitespace = grapheme.is_whitespace();
406
406
407− // TODO is it correct to apply the whitspace style to all unicode white spaces?
407+ // TODO is it correct to apply the whitespace style to all unicode white spaces?
408 if is_whitespace {
408 if is_whitespace {
409 style = style.patch(self.whitespace_style);
409 style = style.patch(self.whitespace_style);
410 }
410 }
helix-term/src/ui/fuzzy_match.rs+3−3
@@ -54,7 +54,7 @@ impl QueryAtom {
54 }
54 }
55
55
56 fn indices(&self, matcher: &Matcher, item: &str, indices: &mut Vec<usize>) -> bool {
56 fn indices(&self, matcher: &Matcher, item: &str, indices: &mut Vec<usize>) -> bool {
57− // for inverse there are no indicies to return
57+ // for inverse there are no indices to return
58 // just return whether we matched
58 // just return whether we matched
59 if self.inverse {
59 if self.inverse {
60 return self.matches(matcher, item);
60 return self.matches(matcher, item);
@@ -120,7 +120,7 @@ enum QueryAtomKind {
120 ///
120 ///
121 /// Usage: `foo`
121 /// Usage: `foo`
122 Fuzzy,
122 Fuzzy,
123− /// Item contains query atom as a continous substring
123+ /// Item contains query atom as a continuous substring
124 ///
124 ///
125 /// Usage `'foo`
125 /// Usage `'foo`
126 Substring,
126 Substring,
@@ -213,7 +213,7 @@ impl FuzzyQuery {
213 Some(score)
213 Some(score)
214 }
214 }
215
215
216− pub fn fuzzy_indicies(&self, item: &str, matcher: &Matcher) -> Option<(i64, Vec<usize>)> {
216+ pub fn fuzzy_indices(&self, item: &str, matcher: &Matcher) -> Option<(i64, Vec<usize>)> {
217 let (score, mut indices) = self.first_fuzzy_atom.as_ref().map_or_else(
217 let (score, mut indices) = self.first_fuzzy_atom.as_ref().map_or_else(
218 || Some((0, Vec::new())),
218 || Some((0, Vec::new())),
219 |atom| matcher.fuzzy_indices(item, atom),
219 |atom| matcher.fuzzy_indices(item, atom),
helix-term/src/ui/fuzzy_match/test.rs+2−2
@@ -7,8 +7,8 @@ fn run_test<'a>(query: &str, items: &'a [&'a str]) -> Vec<String> {
7 items
7 items
8 .iter()
8 .iter()
9 .filter_map(|item| {
9 .filter_map(|item| {
10− let (_, indicies) = query.fuzzy_indicies(item, &matcher)?;
10+ let (_, indices) = query.fuzzy_indices(item, &matcher)?;
11− let matched_string = indicies
11+ let matched_string = indices
12 .iter()
12 .iter()
13 .map(|&pos| item.chars().nth(pos).unwrap())
13 .map(|&pos| item.chars().nth(pos).unwrap())
14 .collect();
14 .collect();
helix-term/src/ui/overlay.rs+1−1
@@ -16,7 +16,7 @@ pub struct Overlay<T> {
16}
16}
17
17
18/// Surrounds the component with a margin of 5% on each side, and an additional 2 rows at the bottom
18/// Surrounds the component with a margin of 5% on each side, and an additional 2 rows at the bottom
19−pub fn overlayed<T>(content: T) -> Overlay<T> {
19+pub fn overlaid<T>(content: T) -> Overlay<T> {
20 Overlay {
20 Overlay {
21 content,
21 content,
22 calc_child_size: Box::new(|rect: Rect| clip_rect_relative(rect.clip_bottom(2), 90, 90)),
22 calc_child_size: Box::new(|rect: Rect| clip_rect_relative(rect.clip_bottom(2), 90, 90)),
helix-term/src/ui/picker.rs+1−1
@@ -794,7 +794,7 @@ impl<T: Item + 'static> Component for Picker<T> {
794 // might be inconsistencies. This is the best we can do since only the
794 // might be inconsistencies. This is the best we can do since only the
795 // text in Row is displayed to the end user.
795 // text in Row is displayed to the end user.
796 let (_score, highlights) = FuzzyQuery::new(self.prompt.line())
796 let (_score, highlights) = FuzzyQuery::new(self.prompt.line())
797− .fuzzy_indicies(&line, &self.matcher)
797+ .fuzzy_indices(&line, &self.matcher)
798 .unwrap_or_default();
798 .unwrap_or_default();
799
799
800 let highlight_byte_ranges: Vec<_> = line
800 let highlight_byte_ranges: Vec<_> = line
helix-term/tests/test/movement.rs+1−1
@@ -391,7 +391,7 @@ async fn cursor_position_newly_opened_file() -> anyhow::Result<()> {
391
391
392#[tokio::test(flavor = "multi_thread")]
392#[tokio::test(flavor = "multi_thread")]
393async fn cursor_position_append_eof() -> anyhow::Result<()> {
393async fn cursor_position_append_eof() -> anyhow::Result<()> {
394− // Selection is fowards
394+ // Selection is forwards
395 test((
395 test((
396 "#[foo|]#",
396 "#[foo|]#",
397 "abar<esc>",
397 "abar<esc>",
helix-tui/src/backend/crossterm.rs+3−3
@@ -344,9 +344,9 @@ impl ModifierDiff {
344 }
344 }
345}
345}
346
346
347−/// Crossterm uses semicolon as a seperator for colors
347+/// Crossterm uses semicolon as a separator for colors
348−/// this is actually not spec compliant (altough commonly supported)
348+/// this is actually not spec compliant (although commonly supported)
349−/// However the correct approach is to use colons as a seperator.
349+/// However the correct approach is to use colons as a separator.
350/// This usually doesn't make a difference for emulators that do support colored underlines.
350/// This usually doesn't make a difference for emulators that do support colored underlines.
351/// However terminals that do not support colored underlines will ignore underlines colors with colons
351/// However terminals that do not support colored underlines will ignore underlines colors with colons
352/// while escape sequences with semicolons are always processed which leads to weird visual artifacts.
352/// while escape sequences with semicolons are always processed which leads to weird visual artifacts.
helix-view/src/editor.rs+1−1
@@ -851,7 +851,7 @@ pub struct Editor {
851 pub config_events: (UnboundedSender<ConfigEvent>, UnboundedReceiver<ConfigEvent>),
851 pub config_events: (UnboundedSender<ConfigEvent>, UnboundedReceiver<ConfigEvent>),
852 /// Allows asynchronous tasks to control the rendering
852 /// Allows asynchronous tasks to control the rendering
853 /// The `Notify` allows asynchronous tasks to request the editor to perform a redraw
853 /// The `Notify` allows asynchronous tasks to request the editor to perform a redraw
854− /// The `RwLock` blocks the editor from performing the render until an exclusive lock can be aquired
854+ /// The `RwLock` blocks the editor from performing the render until an exclusive lock can be acquired
855 pub redraw_handle: RedrawHandle,
855 pub redraw_handle: RedrawHandle,
856 pub needs_redraw: bool,
856 pub needs_redraw: bool,
857 /// Cached position of the cursor calculated during rendering.
857 /// Cached position of the cursor calculated during rendering.
helix-view/src/theme.rs+1−1
@@ -128,7 +128,7 @@ impl Loader {
128 let parent_palette = parent_theme_toml.get("palette");
128 let parent_palette = parent_theme_toml.get("palette");
129 let palette = theme_toml.get("palette");
129 let palette = theme_toml.get("palette");
130
130
131− // handle the table seperately since it needs a `merge_depth` of 2
131+ // handle the table separately since it needs a `merge_depth` of 2
132 // this would conflict with the rest of the theme merge strategy
132 // this would conflict with the rest of the theme merge strategy
133 let palette_values = match (parent_palette, palette) {
133 let palette_values = match (parent_palette, palette) {
134 (Some(parent_palette), Some(palette)) => {
134 (Some(parent_palette), Some(palette)) => {