diff options
author | Pavel Roskin <1317472+proski@users.noreply.github.com> | 2023-10-25 16:20:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-25 23:20:58 +0000 |
commit | 75eef3be9680dbe3300186b06e19eac7f9dfab4b (patch) | |
tree | e59127474f8bdaae5be26dc53d25c3c9ed86d379 /alacritty/src | |
parent | 500b696ca8ed61c42f5954b10f1294e875d792ae (diff) | |
download | r-alacritty-75eef3be9680dbe3300186b06e19eac7f9dfab4b.tar.gz r-alacritty-75eef3be9680dbe3300186b06e19eac7f9dfab4b.tar.bz2 r-alacritty-75eef3be9680dbe3300186b06e19eac7f9dfab4b.zip |
Fix typos
Diffstat (limited to 'alacritty/src')
-rw-r--r-- | alacritty/src/config/bindings.rs | 2 | ||||
-rw-r--r-- | alacritty/src/config/monitor.rs | 2 | ||||
-rw-r--r-- | alacritty/src/display/content.rs | 2 | ||||
-rw-r--r-- | alacritty/src/display/hint.rs | 4 | ||||
-rw-r--r-- | alacritty/src/display/mod.rs | 6 | ||||
-rw-r--r-- | alacritty/src/event.rs | 6 | ||||
-rw-r--r-- | alacritty/src/input.rs | 2 | ||||
-rw-r--r-- | alacritty/src/logging.rs | 2 | ||||
-rw-r--r-- | alacritty/src/renderer/mod.rs | 6 | ||||
-rw-r--r-- | alacritty/src/renderer/shader.rs | 12 | ||||
-rw-r--r-- | alacritty/src/renderer/text/builtin_font.rs | 16 | ||||
-rw-r--r-- | alacritty/src/string.rs | 12 | ||||
-rw-r--r-- | alacritty/src/window_context.rs | 2 |
13 files changed, 37 insertions, 37 deletions
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<PathBuf>, event_proxy: EventLoopProxy<Event>) { // 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<T>(term: &Term<T>, dfas: &mut RegexSearch) -> Self { let matches = hint::visible_regex_match_iter(term, dfas).collect::<Vec<_>>(); 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<T>(term: &Term<T>, 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<T>( @@ -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<T> 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<T: EventListener, A: ActionContext<T>> Processor<T, A> { // 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<RendererPreference>, + renderer_preference: Option<RendererPreference>, ) -> Result<Self, Error> { // 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<HashSet<&'static str, RandomState>> = 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<Self, ShaderError> { let version_header = shader_version.shader_header(); let mut sources = Vec::<*const GLchar>::with_capacity(3); - let mut lengthes = Vec::<GLint>::with_capacity(3); + let mut lengths = Vec::<GLint>::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<i8>) -> 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<Chars<'a>>, - accumulted_len: usize, + accumulated_len: usize, max_width: usize, direction: ShortenDirection, shortener: Option<char>, @@ -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<Event>, proxy: EventLoopProxy<Event>, |