chore: clean up typos

This commit is contained in:
Łukasz Niemier
2024-08-05 13:56:57 +02:00
parent 1b386faee9
commit f9be02a20f
46 changed files with 135 additions and 66 deletions

View File

@@ -84,7 +84,7 @@ mouse: Mouse,
///
/// Also note the utf8 value is not valid for this event so some unfocused
/// release events may not send exactly the right data within Kitty keyboard
/// events. This seems unspecificed in the spec so for now I'm okay with
/// events. This seems unspecified in the spec so for now I'm okay with
/// this. Plus, its only for release events where the key text is far
/// less important.
pressed_key: ?input.KeyEvent = null,
@@ -1262,7 +1262,7 @@ pub fn preeditCallback(self: *Surface, preedit_: ?[]const u8) !void {
}
/// Called for any key events. This handles keybindings, encoding and
/// sending to the termianl, etc.
/// sending to the terminal, etc.
pub fn keyCallback(
self: *Surface,
event: input.KeyEvent,
@@ -2075,7 +2075,7 @@ fn mouseShiftCapture(self: *const Surface, lock: bool) bool {
if (lock) self.renderer_state.mutex.lock();
defer if (lock) self.renderer_state.mutex.unlock();
// If thet terminal explicitly requests it then we always allow it
// If the terminal explicitly requests it then we always allow it
// since we processed never/always at this point.
switch (self.io.terminal.flags.mouse_shift_capture) {
.false => return false,
@@ -2153,7 +2153,7 @@ pub fn mouseButtonCallback(
self.modsChanged(mods);
// This is set to true if the terminal is allowed to capture the shift
// modifer. Note we can do this more efficiently probably with less
// modifier. Note we can do this more efficiently probably with less
// locking/unlocking but clicking isn't that frequent enough to be a
// bottleneck.
const shift_capture = self.mouseShiftCapture(true);
@@ -2833,7 +2833,7 @@ fn dragLeftClickDouble(
};
// If our current mouse position is before the starting position,
// then the seletion start is the word nearest our current position.
// then the selection start is the word nearest our current position.
if (drag_pin.before(click_pin)) {
try self.setSelection(terminal.Selection.init(
word_current.start(),

View File

@@ -1765,7 +1765,7 @@ pub const CAPI = struct {
return true;
}
/// Complete a clipboard read request startd via the read callback.
/// Complete a clipboard read request started via the read callback.
/// This can only be called once for a given request. Once it is called
/// with a request the request pointer will be invalidated.
export fn ghostty_surface_complete_clipboard_request(
@@ -1817,7 +1817,7 @@ pub const CAPI = struct {
const content_scale = ptr.getContentScale() catch return null;
// Get the shared font grid. We acquire a read lock to
// read the font face. It should not be deffered since
// read the font face. It should not be deferred since
// we're loading the primary face.
const grid = ptr.core_surface.renderer.font_grid;
grid.lock.lockShared();

View File

@@ -565,7 +565,7 @@ fn realize(self: *Surface) !void {
try self.core_surface.setFontSize(size);
}
// Set the intial color scheme
// Set the initial color scheme
try self.core_surface.colorSchemeCallback(self.app.getColorScheme());
// Note we're realized
@@ -1222,7 +1222,7 @@ fn gtkRealize(area: *c.GtkGLArea, ud: ?*anyopaque) callconv(.C) void {
};
// When we have a realized surface, we also attach our input method context.
// We do this here instead of init because this allows us to relase the ref
// We do this here instead of init because this allows us to release the ref
// to the GLArea when we unrealized.
c.gtk_im_context_set_client_widget(self.im_context, @ptrCast(@alignCast(self.overlay)));
}
@@ -1854,7 +1854,7 @@ fn gtkInputCommit(
self.im_composing = false;
// We're not in a keypress, so this was sent from an on-screen emoji
// keyboard or someting like that. Send the characters directly to
// keyboard or something like that. Send the characters directly to
// the surface.
_ = self.core_surface.keyCallback(.{
.action = .press,

View File

@@ -11,7 +11,7 @@ const font = @import("font/main.zig");
const rendererpkg = @import("renderer.zig");
const WasmTarget = @import("os/wasm/target.zig").Target;
/// The build configuratin options. This may not be all available options
/// The build configurations options. This may not be all available options
/// to `zig build` but it contains all the options that the Ghostty source
/// needs to know about at comptime.
///
@@ -51,7 +51,7 @@ pub const BuildConfig = struct {
// Our version. We also add the string version so we don't need
// to do any allocations at runtime. This has to be long enough to
// accomodate realistic large branch names for dev versions.
// accommodate realistic large branch names for dev versions.
var buf: [1024]u8 = undefined;
step.addOption(std.SemanticVersion, "app_version", self.version);
step.addOption([:0]const u8, "app_version_string", try std.fmt.bufPrintZ(

View File

@@ -5,7 +5,7 @@ const Allocator = std.mem.Allocator;
const help_strings = @import("help_strings");
pub const Options = struct {
/// If `true`, print out documenation about the action associated with the
/// If `true`, print out documentation about the action associated with the
/// keybinds.
docs: bool = false,

View File

@@ -45,7 +45,7 @@ pub const Config = struct {
/// same priority order Ghostty would use to pick a font.
///
/// The `--family` argument can be used to filter results to a specific family.
/// The family handling is identical to the `font-familiy` set of Ghostty
/// The family handling is identical to the `font-family` set of Ghostty
/// configuration values, so this can be used to debug why your desired font may
/// not be loading.
///

View File

@@ -11,7 +11,7 @@ pub const Options = struct {
/// in the config file.
default: bool = false,
/// If `true`, print out documenation about the action associated with the
/// If `true`, print out documentation about the action associated with the
/// keybinds.
docs: bool = false,

View File

@@ -1023,7 +1023,7 @@ keybind: Keybinds = .{},
/// are scaled-up RGB values, where each component are 16 bits. This is how
/// most terminals report these values. However, some legacy applications may
/// require 8-bit, unscaled, components. We also support turning off reporting
/// alltogether. The components are lowercase hex values.
/// altogether. The components are lowercase hex values.
///
/// Allowable values are:
///
@@ -1102,7 +1102,7 @@ keybind: Keybinds = .{},
///
/// * `visible-menu` - Use non-native macOS fullscreen, keep the menu bar visible
/// * `true` - Use non-native macOS fullscreen, hide the menu bar
/// * `false` - Use native macOS fullscreeen
/// * `false` - Use native macOS fullscreen
///
@"macos-non-native-fullscreen": NonNativeFullscreen = .false,
@@ -2114,7 +2114,7 @@ fn loadTheme(self: *Config, theme: []const u8) !void {
defer file.close();
// From this point onwards, we load the theme and do a bit of a dance
// to achive two separate goals:
// to achieve two separate goals:
//
// (1) We want the theme to be loaded and our existing config to
// override the theme. So we need to load the theme and apply
@@ -2125,7 +2125,7 @@ fn loadTheme(self: *Config, theme: []const u8) !void {
//
// Point 2 is strictly a result of aur approach to point 1.
// Keep track of our replay length prior ot loading the theme
// Keep track of our replay length prior to loading the theme
// so that we can replay the previous config to override values.
const replay_len = self._replay_steps.items.len;
@@ -2719,7 +2719,7 @@ pub const Color = packed struct(u24) {
}
pub fn parseCLI(input_: ?[]const u8) !Color {
const input = input_ orelse return error.ValueRequred;
const input = input_ orelse return error.ValueRequired;
if (terminal.x11_color.map.get(input)) |rgb| return .{
.r = rgb.r,

View File

@@ -74,7 +74,7 @@ test "url regex" {
.expect = "https://example.com",
},
.{
.input = "some file wih https://google.com https://duckduckgo.com links.",
.input = "some file with https://google.com https://duckduckgo.com links.",
.expect = "https://google.com",
},
.{

View File

@@ -147,7 +147,7 @@ pub fn getIndex(
// Build our presentation mode. If we don't have an explicit presentation
// given then we use the UCD (Unicode Character Database) to determine
// the default presentation. Note there is some inefficiency here because
// we'll do this muliple times if we recurse, but this is a cached function
// we'll do this multiple times if we recurse, but this is a cached function
// call higher up (GroupCache) so this should be rare.
const p_mode: Collection.PresentationMode = if (p) |v| .{ .explicit = v } else .{
.default = if (ziglyph.emoji.isEmojiPresentation(@intCast(cp)))

View File

@@ -285,7 +285,7 @@ pub fn hasCodepoint(self: DeferredFace, cp: u32, p: ?Presentation) bool {
// because forced presentation modes are only used for emoji and
// emoji should always have color glyphs set. This can be
// more correct by using the isColorGlyph logic but I'd want
// to find a font that actualy requires this so we can write
// to find a font that actually requires this so we can write
// a test for it before changing it.
if (p) |desired_p| {
const traits = ct.font.getSymbolicTraits();

View File

@@ -445,7 +445,7 @@ pub const CoreText = struct {
assert(desc.codepoint > 0);
// Get our original font. This is dependent on the requestd style
// Get our original font. This is dependent on the requested style
// from the descriptor.
const original = original: {
// In all the styles below, we try to match it but if we don't
@@ -716,7 +716,7 @@ test "descriptor hash" {
try testing.expect(d.hashcode() != 0);
}
test "descriptor hash familiy names" {
test "descriptor hash family names" {
const testing = std.testing;
var d1: Descriptor = .{ .family = "A" };

View File

@@ -495,7 +495,7 @@ pub const Shaper = struct {
// If this grid doesn't match the one we've cached fonts for,
// then we reset the cache list since it's no longer valid.
// We use an intFromPtr rather than direct pointer comparison
// because we don't want anyone to inadvertenly use the pointer.
// because we don't want anyone to inadvertently use the pointer.
const grid_id: usize = @intFromPtr(grid);
if (grid_id != self.cached_font_grid) {
if (self.cached_font_grid > 0) {

View File

@@ -2516,7 +2516,7 @@ fn draw_dash_vertical(
// | | |
// | |
// +-----------+
// Our dashed line should be made such that when tiled verically it
// Our dashed line should be made such that when tiled vertically it
// it creates one consistent line with no uneven gap or segment sizes.
// In order to make sure this is the case, we should have an extra gap
// gap at the bottom.

View File

@@ -184,7 +184,7 @@ const Draw = struct {
break :pos y_max - (MIN_AMPLITUDE * 2);
};
// The full aplitude of the wave can be from the bottom to the
// The full amplitude of the wave can be from the bottom to the
// underline position. We also calculate our mid y point of the wave
const double_amplitude: f64 = @floatFromInt(y_max - pos);
const half_amplitude: f64 = @max(1, double_amplitude / 4);

View File

@@ -692,7 +692,7 @@ const CsiUMods = packed struct(u3) {
return raw + 1;
}
test "modifer sequence values" {
test "modifier sequence values" {
// This is all sort of trivially seen by looking at the code but
// we want to make sure we never regress this.
var mods: CsiUMods = .{};
@@ -775,7 +775,7 @@ const KittyMods = packed struct(u8) {
return raw + 1;
}
test "modifer sequence values" {
test "modifier sequence values" {
// This is all sort of trivially seen by looking at the code but
// we want to make sure we never regress this.
var mods: KittyMods = .{};

View File

@@ -275,7 +275,7 @@ fn cursorKey(
/// format should have exactly one "hole" for the mods code.
/// Example: "\x1b[11;{}~" for F1.
fn pcStyle(comptime fmt: []const u8) []Entry {
// The comptime {} wrapper is superflous but it prevents us from
// The comptime {} wrapper is superfluous but it prevents us from
// accidentally running this function at runtime.
comptime {
var entries: [modifiers.len]Entry = undefined;

View File

@@ -1205,7 +1205,7 @@ pub fn drawFrame(self: *Metal, surface: *apprt.Surface) !void {
break :desc desc;
};
// Prepare our color atachment (output).
// Prepare our color attachment (output).
const attachments = objc.Object.fromId(desc.getProperty(?*anyopaque, "colorAttachments"));
const attachment = attachments.msgSend(
objc.Object,
@@ -1954,7 +1954,7 @@ pub fn setScreenSize(
// Blank space around the grid.
const blank: renderer.Padding = switch (self.config.padding_color) {
// We can use zero padding because the backgroudn color is our
// We can use zero padding because the background color is our
// clear color.
.background => .{},
@@ -2565,7 +2565,7 @@ fn addCursor(
cursor_color: terminal.color.RGB,
) void {
// Add the cursor. We render the cursor over the wide character if
// we're on the wide characer tail.
// we're on the wide character tail.
const wide, const x = cell: {
// The cursor goes over the screen cursor position.
const cell = screen.cursor.page_cell;

View File

@@ -165,7 +165,7 @@ const SetScreenSize = struct {
// Blank space around the grid.
const blank: renderer.Padding = switch (r.config.padding_color) {
// We can use zero padding because the backgroudn color is our
// We can use zero padding because the background color is our
// clear color.
.background => .{},
@@ -1485,7 +1485,7 @@ fn addCursor(
cursor_color: terminal.color.RGB,
) !?*const CellProgram.Cell {
// Add the cursor. We render the cursor over the wide character if
// we're on the wide characer tail.
// we're on the wide character tail.
const wide, const x = cell: {
// The cursor goes over the screen cursor position.
const cell = screen.cursor.page_cell;
@@ -1923,7 +1923,7 @@ fn flushAtlasSingle(
atlas: *font.Atlas,
modified: *usize,
resized: *usize,
interal_format: gl.Texture.InternalFormat,
internal_format: gl.Texture.InternalFormat,
format: gl.Texture.Format,
) !void {
// If the texture isn't modified we do nothing
@@ -1941,7 +1941,7 @@ fn flushAtlasSingle(
if (new_resized > resized.*) {
try texbind.image2D(
0,
interal_format,
internal_format,
@intCast(atlas.size),
@intCast(atlas.size),
0,

View File

@@ -230,7 +230,7 @@ fn threadMain_(self: *Thread) !void {
}
fn startDrawTimer(self: *Thread) void {
// If our renderer doesn't suppoort animations then we never run this.
// If our renderer doesn't support animations then we never run this.
if (!@hasDecl(renderer.Renderer, "hasAnimations")) return;
if (!self.renderer.hasAnimations()) return;
if (self.config.custom_shader_animation == .false) return;

View File

@@ -102,7 +102,7 @@ test "cursor: blinking disabled" {
try testing.expect(cursorStyle(&state, false, false) == .block_hollow);
}
test "cursor: explictly not visible" {
test "cursor: explicitly not visible" {
const testing = std.testing;
const alloc = testing.allocator;
var term = try terminal.Terminal.init(alloc, .{ .cols = 10, .rows = 10 });

View File

@@ -65,7 +65,7 @@ pub fn Buffer(comptime T: type) type {
}
/// Sync new contents to the buffer. The data is expected to be the
/// complete contents of the buffer. If the amont of data is larger
/// complete contents of the buffer. If the amount of data is larger
/// than the buffer length, the buffer will be reallocated.
///
/// If the amount of data is smaller than the buffer length, the

View File

@@ -42,7 +42,7 @@ pub fn loadFromFile(
defer arena.deinit();
const alloc = arena.allocator();
// Load the shader fiel
// Load the shader file
const cwd = std.fs.cwd();
const file = try cwd.openFile(path, .{});
defer file.close();

View File

@@ -2424,7 +2424,7 @@ fn pinIsValid(self: *const PageList, p: Pin) bool {
return false;
}
/// Returns the viewport for the given pin, prefering to pin to
/// Returns the viewport for the given pin, preferring to pin to
/// "active" if the pin is within the active area.
fn pinIsActive(self: *const PageList, p: Pin) bool {
// If the pin is in the active page, then we can quickly determine
@@ -2519,7 +2519,7 @@ pub fn getCell(self: *const PageList, pt: point.Point) ?Cell {
/// 124 | | | 0
/// 125 |Text | | 1
/// : ^ : : = PIN 0
/// 126 |Wrapp… | 2
/// 126 |Wrap… | 2
/// +-----+ :
/// +-----+ : = PAGE 1
/// 0 …ed | | 3
@@ -2822,7 +2822,7 @@ pub const RowIterator = struct {
}
};
/// Create an interator that can be used to iterate all the rows in
/// Create an iterator that can be used to iterate all the rows in
/// a region of the screen from the given top-left. The tag of the
/// top-left point will also determine the end of the iteration,
/// so convert from one reference point to another to change the

View File

@@ -1182,7 +1182,7 @@ fn resizeInternal(
});
// If we have no scrollback and we shrunk our rows, we must explicitly
// erase our history. This is beacuse PageList always keeps at least
// erase our history. This is because PageList always keeps at least
// a page size of history.
if (self.no_scrollback) {
self.pages.eraseRows(.{ .history = .{} }, null);

View File

@@ -356,7 +356,7 @@ pub fn adjust(
adjustment: Adjustment,
) void {
// Note that we always adjust "end" because end always represents
// the last point of the selection by mouse, not necessarilly the
// the last point of the selection by mouse, not necessarily the
// top/bottom visually. So this results in the correct behavior
// whether the user drags up or down.
const end_pin = self.endPtr();

View File

@@ -492,7 +492,7 @@ pub fn print(self: *Terminal, c: u21) !void {
self.printCell(0, .spacer_tail);
} else {
// This is pretty broken, terminals should never be only 1-wide.
// We sould prevent this downstream.
// We should prevent this downstream.
self.screen.cursorMarkDirty();
self.printCell(0, .narrow);
},
@@ -867,7 +867,7 @@ pub fn cursorLeft(self: *Terminal, count_req: usize) void {
// UNDEFINED TERMINAL BEHAVIOR. This situation is not handled in xterm
// and currently results in a crash in xterm. Given no other known
// terminal [to me] implements XTREVWRAP2, I decided to just mimick
// terminal [to me] implements XTREVWRAP2, I decided to just mimic
// the behavior of xterm up and not including the crash by wrapping
// up to the (0, 0) and stopping there. My reasoning is that for an
// appropriately sized value of "count" this is the behavior that xterm

View File

@@ -16,7 +16,7 @@ pub const Command = union(enum) {
/// Set the window title of the terminal
///
/// If title mode 0 is set text is expect to be hex encoded (i.e. utf-8
/// with each code unit further encoded with two hex digets).
/// with each code unit further encoded with two hex digits).
///
/// If title mode 2 is set or the terminal is setup for unconditional
/// utf-8 titles text is interpreted as utf-8. Else text is interpreted

View File

@@ -172,7 +172,7 @@ pub const Page = struct {
/// The current dimensions of the page. The capacity may be larger
/// than this. This allows us to allocate a larger page than necessary
/// and also to resize a page smaller witout reallocating.
/// and also to resize a page smaller without reallocating.
size: Size,
/// The capacity of this page. This is the full size of the backing

View File

@@ -16,7 +16,7 @@ pub const Tag = enum {
/// because it includes the full height (rows) of the screen, including
/// rows that may not be written yet. This is required because the active
/// area is fully "addressable" by the running program (see below) whereas
/// the other tags are used primarliy for reading/modifying past-written
/// the other tags are used primarily for reading/modifying past-written
/// data so they can't address unwritten rows.
///
/// Note for those less familiar with terminal functionality: there
@@ -36,7 +36,7 @@ pub const Tag = enum {
/// Top-left is the furthest back in the scrollback history
/// supported by the screen and the bottom-right is the bottom-right
/// of the last written row. Note this last point is important: the
/// bottom right is NOT necessarilly the same as "active" because
/// bottom right is NOT necessarily the same as "active" because
/// "active" always allows referencing the full rows tall of the
/// screen whereas "screen" only contains written rows.
screen,

View File

@@ -21,7 +21,7 @@ const fastmem = @import("../fastmem.zig");
/// reference count. The caller is responsible for calling release for an
/// item when it is no longer being used. Items with 0 references will be
/// kept until another item is written to their bucket. This allows items
/// to be ressurected if they are re-added before they get overwritten.
/// to be resurrected if they are re-added before they get overwritten.
///
/// The backing data structure of this set is an open addressed hash table
/// with linear probing and Robin Hood hashing, and a flat array of items.

View File

@@ -158,7 +158,7 @@ pub fn Stream(comptime Handler: type) type {
return offset;
}
/// Like nextSlice but takes one byte and is necessarilly a scalar
/// Like nextSlice but takes one byte and is necessarily a scalar
/// operation that can't use SIMD. Prefer nextSlice if you can and
/// try to get multiple bytes at once.
pub fn next(self: *Self, c: u8) !void {

View File

@@ -231,7 +231,7 @@ fn setupBash(
);
try env.put("ENV", integ_dir);
// Join the acculumated arguments to form the final command string.
// Join the accumulated arguments to form the final command string.
return try std.mem.join(alloc, " ", args.items);
}