Fix typos

This commit is contained in:
Pavel Roskin 2023-10-25 16:20:58 -07:00 committed by GitHub
parent 500b696ca8
commit 75eef3be96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 49 additions and 49 deletions

View File

@ -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.

View File

@ -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")]

View File

@ -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())
});

View File

@ -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)

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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,

View File

@ -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 {

View File

@ -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";

View File

@ -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();

View File

@ -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);

View File

@ -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.);

View File

@ -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();

View File

@ -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>,

View File

@ -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,

View File

@ -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<dyn Fn(&str) -> 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<dyn Fn(Rgb) -> String + Sync + Send + 'static>),

View File

@ -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]
}

View File

@ -80,10 +80,10 @@ impl<T> Storage<T> {
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;

View File

@ -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::<Cell>() <= EXPECTED_CELL_SIZE);
}

View File

@ -402,7 +402,7 @@ impl<T> Term<T> {
// 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);
}

View File

@ -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.