From 75eef3be9680dbe3300186b06e19eac7f9dfab4b Mon Sep 17 00:00:00 2001 From: Pavel Roskin <1317472+proski@users.noreply.github.com> Date: Wed, 25 Oct 2023 16:20:58 -0700 Subject: [PATCH] Fix typos --- CONTRIBUTING.md | 2 +- alacritty/src/config/bindings.rs | 2 +- alacritty/src/config/monitor.rs | 2 +- alacritty/src/display/content.rs | 2 +- alacritty/src/display/hint.rs | 4 ++-- alacritty/src/display/mod.rs | 6 +++--- alacritty/src/event.rs | 6 +++--- alacritty/src/input.rs | 2 +- alacritty/src/logging.rs | 2 +- alacritty/src/renderer/mod.rs | 6 +++--- alacritty/src/renderer/shader.rs | 12 ++++++------ alacritty/src/renderer/text/builtin_font.rs | 16 ++++++++-------- alacritty/src/string.rs | 12 ++++++------ alacritty/src/window_context.rs | 2 +- alacritty_terminal/src/config/mod.rs | 2 +- alacritty_terminal/src/event.rs | 4 ++-- alacritty_terminal/src/grid/mod.rs | 4 ++-- alacritty_terminal/src/grid/storage.rs | 4 ++-- alacritty_terminal/src/term/cell.rs | 2 +- alacritty_terminal/src/term/mod.rs | 2 +- extra/man/alacritty.5.scd | 4 ++-- 21 files changed, 49 insertions(+), 49 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 14f25704..427b26a9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -114,7 +114,7 @@ Alacritty's release process aims to provide stable and well tested releases with back new features during the testing period. To achieve these goals, a new branch is created for every new release. Both the release candidates -and the final version are only comitted and tagged in this branch. The master branch only tracks +and the final version are only committed and tagged in this branch. The master branch only tracks development versions, allowing us to keep the branches completely separate without merging releases back into master. diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs index 914d25ff..c56445f3 100644 --- a/alacritty/src/config/bindings.rs +++ b/alacritty/src/config/bindings.rs @@ -224,7 +224,7 @@ pub enum Action { SelectTab8, #[cfg(target_os = "macos")] - /// Select the nineth tab. + /// Select the ninth tab. SelectTab9, #[cfg(target_os = "macos")] diff --git a/alacritty/src/config/monitor.rs b/alacritty/src/config/monitor.rs index 3548fc02..f4b39a22 100644 --- a/alacritty/src/config/monitor.rs +++ b/alacritty/src/config/monitor.rs @@ -24,7 +24,7 @@ pub fn watch(mut paths: Vec, event_proxy: EventLoopProxy) { // Exclude char devices like `/dev/null`, sockets, and so on, by checking that file type is a // regular file. paths.retain(|path| { - // Call `metadata` to resolve symbolink links. + // Call `metadata` to resolve symbolic links. path.metadata().map_or(false, |metadata| metadata.file_type().is_file()) }); diff --git a/alacritty/src/display/content.rs b/alacritty/src/display/content.rs index 0849b30a..ba716154 100644 --- a/alacritty/src/display/content.rs +++ b/alacritty/src/display/content.rs @@ -510,7 +510,7 @@ impl<'a> HintMatches<'a> { Self { matches: matches.into(), index: 0 } } - /// Create from regex matches on term visable part. + /// Create from regex matches on term visible part. fn visible_regex_matches(term: &Term, dfas: &mut RegexSearch) -> Self { let matches = hint::visible_regex_match_iter(term, dfas).collect::>(); Self::new(matches) diff --git a/alacritty/src/display/hint.rs b/alacritty/src/display/hint.rs index 8dffdeb5..f508d10c 100644 --- a/alacritty/src/display/hint.rs +++ b/alacritty/src/display/hint.rs @@ -413,7 +413,7 @@ fn hyperlink_at(term: &Term, point: Point) -> Option<(Hyperlink, Match)> { // Find adjacent lines that have the same `hyperlink`. The end purpose to highlight hyperlinks // that span across multiple lines or not directly attached to each other. - // Find the closest to the viewport start adjucent line. + // Find the closest to the viewport start adjacent line. while match_start.line > viewport_start { let next_line = match_start.line - 1i32; // Iterate over all the cells in the grid's line and check if any of those cells contains @@ -697,7 +697,7 @@ mod tests { let term = mock_term(&content); let mut regex = RegexSearch::new("match!").unwrap(); - // The interator should match everything in the viewport. + // The iterator should match everything in the viewport. assert_eq!(visible_regex_match_iter(&term, &mut regex).count(), 4096); } } diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs index 2b5cc348..efd41c04 100644 --- a/alacritty/src/display/mod.rs +++ b/alacritty/src/display/mod.rs @@ -587,7 +587,7 @@ impl Display { } // XXX: this function must not call to any `OpenGL` related tasks. Renderer updates are - // performed in [`Self::process_renderer_update`] right befor drawing. + // performed in [`Self::process_renderer_update`] right before drawing. // /// Process update events. pub fn handle_update( @@ -1378,7 +1378,7 @@ impl Display { } } - /// Requst a new frame for a window on Wayland. + /// Request a new frame for a window on Wayland. fn request_frame(&mut self, scheduler: &mut Scheduler) { // Mark that we've used a frame. self.window.has_frame = false; @@ -1408,7 +1408,7 @@ impl Display { impl Drop for Display { fn drop(&mut self) { // Switch OpenGL context before dropping, otherwise objects (like programs) from other - // contexts might be deleted during droping renderer. + // contexts might be deleted when dropping renderer. self.make_current(); unsafe { ManuallyDrop::drop(&mut self.renderer); diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 6f82be11..281bcace 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -815,7 +815,7 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext for ActionCon // // We remove `\x1b` to ensure it's impossible for the pasted text to write the bracketed // paste end escape `\x1b[201~` and `\x03` since some shells incorrectly terminate - // bracketed paste on its receival. + // bracketed paste when they receive it. let filtered = text.replace(['\x1b', '\x03'], ""); self.write_to_pty(filtered.into_bytes()); @@ -1080,7 +1080,7 @@ impl<'a, N: Notify + 'a, T: EventListener> ActionContext<'a, N, T> { self.scheduler.schedule(event, blinking_timeout_interval, false, timer_id); } - /// Perferm vi mode inline search in the specified direction. + /// Perform vi mode inline search in the specified direction. fn inline_search(&mut self, direction: Direction) { let c = match self.inline_search_state.character { Some(c) => c, @@ -1573,7 +1573,7 @@ impl Processor { // The event loop just got initialized. Create a window. WinitEvent::Resumed => { // Creating window inside event loop is required for platforms like macOS to - // properly initialize state, like tab management. Othwerwise the first + // properly initialize state, like tab management. Otherwise the first // window won't handle tabs. let initial_window_options = match initial_window_options.take() { Some(initial_window_options) => initial_window_options, diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs index f1a8e7d7..b1a25288 100644 --- a/alacritty/src/input.rs +++ b/alacritty/src/input.rs @@ -1127,7 +1127,7 @@ impl> Processor { // We don't want the key without modifier, because it means something else most of // the time. However what we want is to manually lowercase the character to account - // for both small and capital latters on regular characters at the same time. + // for both small and capital letters on regular characters at the same time. let logical_key = if let Key::Character(ch) = key.logical_key.as_ref() { Key::Character(ch.to_lowercase().into()) } else { diff --git a/alacritty/src/logging.rs b/alacritty/src/logging.rs index fffd9c02..ae564a00 100644 --- a/alacritty/src/logging.rs +++ b/alacritty/src/logging.rs @@ -28,7 +28,7 @@ pub const LOG_TARGET_IPC_CONFIG: &str = "alacritty_log_ipc_config"; /// Name for the environment variable containing the log file's path. const ALACRITTY_LOG_ENV: &str = "ALACRITTY_LOG"; -/// Name for the environment varibale containing extra logging targets. +/// Name for the environment variable containing extra logging targets. /// /// The targets are semicolon separated. const ALACRITTY_EXTRA_LOG_TARGETS_ENV: &str = "ALACRITTY_EXTRA_LOG_TARGETS"; diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index 87ccf2f6..bd3c0015 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -92,7 +92,7 @@ impl Renderer { /// supported OpenGL version. pub fn new( context: &PossiblyCurrentContext, - renderer_prefernce: Option, + renderer_preference: Option, ) -> Result { // We need to load OpenGL functions once per instance, but only after we make our context // current due to WGL limitations. @@ -119,7 +119,7 @@ impl Renderer { let is_gles_context = matches!(context.context_api(), ContextApi::Gles(_)); // Use the config option to enforce a particular renderer configuration. - let (use_glsl3, allow_dsb) = match renderer_prefernce { + let (use_glsl3, allow_dsb) = match renderer_preference { Some(RendererPreference::Glsl3) => (true, true), Some(RendererPreference::Gles2) => (false, true), Some(RendererPreference::Gles2Pure) => (false, false), @@ -288,7 +288,7 @@ struct GlExtensions; impl GlExtensions { /// Check if the given `extension` is supported. /// - /// This function will lazyly load OpenGL extensions. + /// This function will lazily load OpenGL extensions. fn contains(extension: &str) -> bool { static OPENGL_EXTENSIONS: OnceCell> = OnceCell::new(); diff --git a/alacritty/src/renderer/shader.rs b/alacritty/src/renderer/shader.rs index 588937cc..e3baab9e 100644 --- a/alacritty/src/renderer/shader.rs +++ b/alacritty/src/renderer/shader.rs @@ -91,17 +91,17 @@ impl Shader { ) -> Result { let version_header = shader_version.shader_header(); let mut sources = Vec::<*const GLchar>::with_capacity(3); - let mut lengthes = Vec::::with_capacity(3); + let mut lengths = Vec::::with_capacity(3); sources.push(version_header.as_ptr().cast()); - lengthes.push(version_header.len() as GLint); + lengths.push(version_header.len() as GLint); if let Some(shader_header) = shader_header { sources.push(shader_header.as_ptr().cast()); - lengthes.push(shader_header.len() as GLint); + lengths.push(shader_header.len() as GLint); } sources.push(source.as_ptr().cast()); - lengthes.push(source.len() as GLint); + lengths.push(source.len() as GLint); let shader = unsafe { Self(gl::CreateShader(kind)) }; @@ -109,9 +109,9 @@ impl Shader { unsafe { gl::ShaderSource( shader.id(), - lengthes.len() as GLint, + lengths.len() as GLint, sources.as_ptr().cast(), - lengthes.as_ptr(), + lengths.as_ptr(), ); gl::CompileShader(shader.id()); gl::GetShaderiv(shader.id(), gl::COMPILE_STATUS, &mut success); diff --git a/alacritty/src/renderer/text/builtin_font.rs b/alacritty/src/renderer/text/builtin_font.rs index 06eb5bc0..3934b30f 100644 --- a/alacritty/src/renderer/text/builtin_font.rs +++ b/alacritty/src/renderer/text/builtin_font.rs @@ -40,7 +40,7 @@ fn box_drawing(character: char, metrics: &Metrics, offset: &Delta) -> Raster // Ensure that width and height is at least one. let height = (metrics.line_height as i32 + offset.y as i32).max(1) as usize; let width = (metrics.average_advance as i32 + offset.x as i32).max(1) as usize; - // Use one eight of the cell width, since this is used as a step size for block elemenets. + // Use one eight of the cell width, since this is used as a step size for block elements. let stroke_size = cmp::max((width as f32 / 8.).round() as usize, 1); let heavy_stroke_size = stroke_size * 2; @@ -704,10 +704,10 @@ impl Canvas { /// vertex and co-vertex respectively using a given `stroke` in the bottom-right quadrant of the /// `Canvas` coordinate system. fn draw_ellipse_arc(&mut self, stroke_size: usize) { - fn colors_with_error(error: f32, max_transparancy: f32) -> (Pixel, Pixel) { - let transparancy = error * max_transparancy; - let alpha_1 = 1. - transparancy; - let alpha_2 = 1. - (max_transparancy - transparancy); + fn colors_with_error(error: f32, max_transparency: f32) -> (Pixel, Pixel) { + let transparency = error * max_transparency; + let alpha_1 = 1. - transparency; + let alpha_2 = 1. - (max_transparency - transparency); let color_1 = Pixel::gray((COLOR_FILL._r as f32 * alpha_1) as u8); let color_2 = Pixel::gray((COLOR_FILL._r as f32 * alpha_2) as u8); (color_1, color_2) @@ -717,7 +717,7 @@ impl Canvas { let v_line_bounds = self.v_line_bounds(self.x_center(), stroke_size); let h_line_bounds = (h_line_bounds.0 as usize, h_line_bounds.1 as usize); let v_line_bounds = (v_line_bounds.0 as usize, v_line_bounds.1 as usize); - let max_transparancy = 0.5; + let max_transparency = 0.5; for (radius_y, radius_x) in (h_line_bounds.0..h_line_bounds.1).zip(v_line_bounds.0..v_line_bounds.1) @@ -733,7 +733,7 @@ impl Canvas { let y = radius_y * f32::sqrt(1. - x * x / radius_x2); let error = y.fract(); - let (color_1, color_2) = colors_with_error(error, max_transparancy); + let (color_1, color_2) = colors_with_error(error, max_transparency); let x = x.clamp(0., radius_x); let y_next = (y + 1.).clamp(0., h_line_bounds.1 as f32 - 1.); @@ -749,7 +749,7 @@ impl Canvas { let x = radius_x * f32::sqrt(1. - y * y / radius_y2); let error = x - x.fract(); - let (color_1, color_2) = colors_with_error(error, max_transparancy); + let (color_1, color_2) = colors_with_error(error, max_transparency); let x_next = (x + 1.).clamp(0., v_line_bounds.1 as f32 - 1.); let x = x.clamp(0., v_line_bounds.1 as f32 - 1.); diff --git a/alacritty/src/string.rs b/alacritty/src/string.rs index a111166d..e41b0785 100644 --- a/alacritty/src/string.rs +++ b/alacritty/src/string.rs @@ -30,7 +30,7 @@ pub enum ShortenDirection { /// Iterator that yield shortened version of the text. pub struct StrShortener<'a> { chars: Skip>, - accumulted_len: usize, + accumulated_len: usize, max_width: usize, direction: ShortenDirection, shortener: Option, @@ -52,7 +52,7 @@ impl<'a> StrShortener<'a> { if direction == ShortenDirection::Right { return Self { chars: text.chars().skip(0), - accumulted_len: 0, + accumulated_len: 0, text_action: TextAction::Char, max_width, direction, @@ -101,7 +101,7 @@ impl<'a> StrShortener<'a> { let chars = text.chars().skip(skip_chars); - Self { chars, accumulted_len: 0, text_action, max_width, direction, shortener } + Self { chars, accumulated_len: 0, text_action, max_width, direction, shortener } } } @@ -134,12 +134,12 @@ impl<'a> Iterator for StrShortener<'a> { let ch_width = ch.width().unwrap_or(1); // Advance width. - self.accumulted_len += ch_width; + self.accumulated_len += ch_width; - if self.accumulted_len > self.max_width { + if self.accumulated_len > self.max_width { self.text_action = TextAction::Terminate; return self.shortener; - } else if self.accumulted_len == self.max_width && self.shortener.is_some() { + } else if self.accumulated_len == self.max_width && self.shortener.is_some() { // Check if we have a next char. let has_next = self.chars.clone().next().is_some(); diff --git a/alacritty/src/window_context.rs b/alacritty/src/window_context.rs index f76faf7a..055c5688 100644 --- a/alacritty/src/window_context.rs +++ b/alacritty/src/window_context.rs @@ -73,7 +73,7 @@ pub struct WindowContext { } impl WindowContext { - /// Create initial window context that dous bootstrapping the graphics Api we're going to use. + /// Create initial window context that does bootstrapping the graphics API we're going to use. pub fn initial( event_loop: &EventLoopWindowTarget, proxy: EventLoopProxy, diff --git a/alacritty_terminal/src/config/mod.rs b/alacritty_terminal/src/config/mod.rs index e70389ec..d713e67b 100644 --- a/alacritty_terminal/src/config/mod.rs +++ b/alacritty_terminal/src/config/mod.rs @@ -50,7 +50,7 @@ pub enum Osc52 { Disabled, /// Only copy sequence is accepted. /// - /// This option is the default as a compromiss between entirely + /// This option is the default as a compromise between entirely /// disabling it (the most secure) and allowing `paste` (the less secure). #[default] OnlyCopy, diff --git a/alacritty_terminal/src/event.rs b/alacritty_terminal/src/event.rs index 4e1d9ec4..5849eb1e 100644 --- a/alacritty_terminal/src/event.rs +++ b/alacritty_terminal/src/event.rs @@ -25,13 +25,13 @@ pub enum Event { /// Request to write the contents of the clipboard to the PTY. /// - /// The attached function is a formatter which will corectly transform the clipboard content + /// The attached function is a formatter which will correctly transform the clipboard content /// into the expected escape sequence format. ClipboardLoad(ClipboardType, Arc String + Sync + Send + 'static>), /// Request to write the RGB value of a color to the PTY. /// - /// The attached function is a formatter which will corectly transform the RGB color into the + /// The attached function is a formatter which will correctly transform the RGB color into the /// expected escape sequence format. ColorRequest(usize, Arc String + Sync + Send + 'static>), diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs index b42c5075..232201ec 100644 --- a/alacritty_terminal/src/grid/mod.rs +++ b/alacritty_terminal/src/grid/mod.rs @@ -568,12 +568,12 @@ pub struct GridIterator<'a, T> { } impl<'a, T> GridIterator<'a, T> { - /// Current iteratior position. + /// Current iterator position. pub fn point(&self) -> Point { self.point } - /// Cell at the current iteratior position. + /// Cell at the current iterator position. pub fn cell(&self) -> &'a T { &self.grid[self.point] } diff --git a/alacritty_terminal/src/grid/storage.rs b/alacritty_terminal/src/grid/storage.rs index e444d9c3..8e270d2d 100644 --- a/alacritty_terminal/src/grid/storage.rs +++ b/alacritty_terminal/src/grid/storage.rs @@ -80,10 +80,10 @@ impl Storage { T: Clone + Default, { // Number of lines the buffer needs to grow. - let growage = next - self.visible_lines; + let additional_lines = next - self.visible_lines; let columns = self[Line(0)].len(); - self.initialize(growage, columns); + self.initialize(additional_lines, columns); // Update visible lines. self.visible_lines = next; diff --git a/alacritty_terminal/src/term/cell.rs b/alacritty_terminal/src/term/cell.rs index ddf6a745..927687fb 100644 --- a/alacritty_terminal/src/term/cell.rs +++ b/alacritty_terminal/src/term/cell.rs @@ -298,7 +298,7 @@ mod tests { // Expected cell size on 64-bit architectures. const EXPECTED_CELL_SIZE: usize = 24; - // Ensure that cell size isn't growning by accident. + // Ensure that cell size isn't growing by accident. assert!(mem::size_of::() <= EXPECTED_CELL_SIZE); } diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index fd537122..46a94f17 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -402,7 +402,7 @@ impl Term { // Add information about old cursor position and new one if they are not the same, so we // cover everything that was produced by `Term::input`. if self.damage.last_cursor != previous_cursor { - // Cursor cooridanates are always inside viewport even if you have `display_offset`. + // Cursor coordinates are always inside viewport even if you have `display_offset`. let point = Point::new(previous_cursor.line.0 as usize, previous_cursor.column); self.damage.damage_point(point); } diff --git a/extra/man/alacritty.5.scd b/extra/man/alacritty.5.scd index 1988c250..57225452 100644 --- a/extra/man/alacritty.5.scd +++ b/extra/man/alacritty.5.scd @@ -853,7 +853,7 @@ https://docs.rs/winit/latest/winit/keyboard/enum.Key.html#variant.Dead *InlineSearchForward* Search forward within the current line. *InlineSearchBcakward* - Search backard within the current line. + Search backward within the current line. *InlineSearchForwardShort* Search forward within the current line, stopping just short of the character. *InlineSearchBackwardShort* @@ -911,7 +911,7 @@ https://docs.rs/winit/latest/winit/keyboard/enum.Key.html#variant.Dead *SelectTab8* Select the eighth tab. *SelectTab9* - Select the nineth tab. + Select the ninth tab. *SelectLastTab* Select the last tab.