diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 91a69bfbad..4860b58d64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -393,3 +393,29 @@ jobs: useDaemon: false # sometimes fails on short jobs - name: alejandra check run: nix develop -c alejandra --check . + + typos: + runs-on: namespace-profile-ghostty-sm + timeout-minutes: 60 + env: + ZIG_LOCAL_CACHE_DIR: /zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /zig/global-cache + steps: + - uses: actions/checkout@v4 # Check out repo so we can lint it + - name: Setup Cache + uses: namespacelabs/nscloud-cache-action@v1.1.6 + with: + path: | + /nix + /zig + - uses: cachix/install-nix-action@V27 + with: + nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/cachix-action@v15 + with: + name: ghostty + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + skipPush: true + useDaemon: false # sometimes fails on short jobs + - name: typos check + run: nix develop -c typos diff --git a/build.zig b/build.zig index 25b903977e..359bb4fdea 100644 --- a/build.zig +++ b/build.zig @@ -445,7 +445,7 @@ pub fn build(b: *std.Build) !void { }); } - // Documenation + // Documentation if (emit_docs) { try buildDocumentation(b, config); } else { diff --git a/dist/macos/update_appcast_tip.py b/dist/macos/update_appcast_tip.py index 2fa0b0d029..8f7d5da548 100644 --- a/dist/macos/update_appcast_tip.py +++ b/dist/macos/update_appcast_tip.py @@ -68,7 +68,7 @@ for item in items[:-prune_amount]: channel.remove(item) -# Create the item using some absoultely terrible XML manipulation. +# Create the item using some absolutely terrible XML manipulation. item = ET.SubElement(channel, "item") elem = ET.SubElement(item, "title") elem.text = f"Build {build}" diff --git a/macos/Sources/Features/Terminal/TerminalController.swift b/macos/Sources/Features/Terminal/TerminalController.swift index ea27b976af..729757dd20 100644 --- a/macos/Sources/Features/Terminal/TerminalController.swift +++ b/macos/Sources/Features/Terminal/TerminalController.swift @@ -267,7 +267,7 @@ class TerminalController: NSWindowController, NSWindowDelegate, // Terminals typically operate in sRGB color space and macOS defaults // to "native" which is typically P3. There is a lot more resources - // covered in thie GitHub issue: https://github.com/mitchellh/ghostty/pull/376 + // covered in this GitHub issue: https://github.com/mitchellh/ghostty/pull/376 // Ghostty defaults to sRGB but this can be overridden. switch (ghostty.config.windowColorspace) { case "display-p3": diff --git a/macos/Sources/Ghostty/Package.swift b/macos/Sources/Ghostty/Package.swift index 5644ad5c0f..93399d4b5b 100644 --- a/macos/Sources/Ghostty/Package.swift +++ b/macos/Sources/Ghostty/Package.swift @@ -136,7 +136,7 @@ extension Ghostty { /// An application is attempting to read from the clipboard using OSC 52 case osc_52_read - /// An applciation is attempting to write to the clipboard using OSC 52 + /// An application is attempting to write to the clipboard using OSC 52 case osc_52_write /// The text to show in the clipboard confirmation prompt for a given request type diff --git a/macos/Sources/Ghostty/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/SurfaceView_AppKit.swift index 8a658242fa..26e5c7d7ab 100644 --- a/macos/Sources/Ghostty/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/SurfaceView_AppKit.swift @@ -894,7 +894,7 @@ extension Ghostty { font.release() } - // Ghostty coordinate system is top-left, conver to bottom-left for AppKit + // Ghostty coordinate system is top-left, convert to bottom-left for AppKit let pt = NSMakePoint(info.tl_px_x - 2, frame.size.height - info.tl_px_y + 2) let str = NSAttributedString.init(string: text, attributes: attributes) self.showDefinition(for: str, at: pt); diff --git a/macos/Sources/Helpers/FullScreenHandler.swift b/macos/Sources/Helpers/FullScreenHandler.swift index 8d72ccc846..89923d5f9c 100644 --- a/macos/Sources/Helpers/FullScreenHandler.swift +++ b/macos/Sources/Helpers/FullScreenHandler.swift @@ -55,7 +55,7 @@ class FullScreenHandler { // It's important to do this in two calls, because setting them in a single call guarantees // that the menu bar will also be hidden on any additional displays (why? nobody knows!) // When these options are set separately, the menu bar hiding problem will only occur in - // specific scenarios. More invesitgation is needed to pin these scenarios down precisely, + // specific scenarios. More investigation is needed to pin these scenarios down precisely, // but it seems to have something to do with which app had focus last. // Furthermore, it's much easier to figure out which screen the dock is on if the menubar // has not yet been hidden, so the order matters here! diff --git a/nix/devShell.nix b/nix/devShell.nix index c645acfac7..3c48420961 100644 --- a/nix/devShell.nix +++ b/nix/devShell.nix @@ -48,6 +48,7 @@ alejandra, pandoc, hyperfine, + typos, }: let # See package.nix. Keep in sync. rpathLibs = @@ -95,6 +96,7 @@ in # Linting nodePackages.prettier alejandra + typos # Testing parallel diff --git a/src/Surface.zig b/src/Surface.zig index 183d4b3f85..4063f1cd4b 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -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(), diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index 37caf7d0f4..82392402b0 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -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(); diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index e356b63423..2a7c7d1838 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -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, diff --git a/src/build_config.zig b/src/build_config.zig index ef360a3537..1d7231978a 100644 --- a/src/build_config.zig +++ b/src/build_config.zig @@ -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( diff --git a/src/cli/list_actions.zig b/src/cli/list_actions.zig index 09feee6ab7..c6a5cf240b 100644 --- a/src/cli/list_actions.zig +++ b/src/cli/list_actions.zig @@ -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, diff --git a/src/cli/list_fonts.zig b/src/cli/list_fonts.zig index 2f6b2cee82..f5210d9bca 100644 --- a/src/cli/list_fonts.zig +++ b/src/cli/list_fonts.zig @@ -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. /// diff --git a/src/cli/list_keybinds.zig b/src/cli/list_keybinds.zig index f2db8fe815..fb98a2a371 100644 --- a/src/cli/list_keybinds.zig +++ b/src/cli/list_keybinds.zig @@ -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, diff --git a/src/config/Config.zig b/src/config/Config.zig index 80beb6fc71..7bca22d483 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -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, diff --git a/src/config/url.zig b/src/config/url.zig index f8969872fa..ad98860a54 100644 --- a/src/config/url.zig +++ b/src/config/url.zig @@ -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", }, .{ diff --git a/src/font/CodepointResolver.zig b/src/font/CodepointResolver.zig index 442a012687..8196d270e7 100644 --- a/src/font/CodepointResolver.zig +++ b/src/font/CodepointResolver.zig @@ -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))) diff --git a/src/font/DeferredFace.zig b/src/font/DeferredFace.zig index fc7c813788..84b5700fee 100644 --- a/src/font/DeferredFace.zig +++ b/src/font/DeferredFace.zig @@ -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(); diff --git a/src/font/discovery.zig b/src/font/discovery.zig index aea5a31ef5..70823989e0 100644 --- a/src/font/discovery.zig +++ b/src/font/discovery.zig @@ -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" }; diff --git a/src/font/shaper/coretext.zig b/src/font/shaper/coretext.zig index 3165a592ce..841b6b5e9a 100644 --- a/src/font/shaper/coretext.zig +++ b/src/font/shaper/coretext.zig @@ -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) { diff --git a/src/font/sprite/Box.zig b/src/font/sprite/Box.zig index 0cc1980d1a..c5064b44a9 100644 --- a/src/font/sprite/Box.zig +++ b/src/font/sprite/Box.zig @@ -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. diff --git a/src/font/sprite/underline.zig b/src/font/sprite/underline.zig index 19e228defb..668b168d6b 100644 --- a/src/font/sprite/underline.zig +++ b/src/font/sprite/underline.zig @@ -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); diff --git a/src/input/KeyEncoder.zig b/src/input/KeyEncoder.zig index 8d056b9323..9236eacecf 100644 --- a/src/input/KeyEncoder.zig +++ b/src/input/KeyEncoder.zig @@ -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 = .{}; diff --git a/src/input/function_keys.zig b/src/input/function_keys.zig index 2b7fd3b8f4..2a54ba12ac 100644 --- a/src/input/function_keys.zig +++ b/src/input/function_keys.zig @@ -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; diff --git a/src/renderer/Metal.zig b/src/renderer/Metal.zig index 7df88afb9f..8a04c4e885 100644 --- a/src/renderer/Metal.zig +++ b/src/renderer/Metal.zig @@ -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; diff --git a/src/renderer/OpenGL.zig b/src/renderer/OpenGL.zig index fc0e183905..9928a9ea4f 100644 --- a/src/renderer/OpenGL.zig +++ b/src/renderer/OpenGL.zig @@ -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, diff --git a/src/renderer/Thread.zig b/src/renderer/Thread.zig index 3ee8ab1b9a..459fc105a3 100644 --- a/src/renderer/Thread.zig +++ b/src/renderer/Thread.zig @@ -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; diff --git a/src/renderer/cursor.zig b/src/renderer/cursor.zig index d7cb7c5bb0..18af9228ed 100644 --- a/src/renderer/cursor.zig +++ b/src/renderer/cursor.zig @@ -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 }); diff --git a/src/renderer/metal/buffer.zig b/src/renderer/metal/buffer.zig index accb1a86f1..55a207f030 100644 --- a/src/renderer/metal/buffer.zig +++ b/src/renderer/metal/buffer.zig @@ -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 diff --git a/src/renderer/shadertoy.zig b/src/renderer/shadertoy.zig index 6f79371022..75c058e201 100644 --- a/src/renderer/shadertoy.zig +++ b/src/renderer/shadertoy.zig @@ -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(); diff --git a/src/terminal/PageList.zig b/src/terminal/PageList.zig index 442cee7e8e..4753838b8e 100644 --- a/src/terminal/PageList.zig +++ b/src/terminal/PageList.zig @@ -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 diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 8ba977b7c6..2170d42a3f 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -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); diff --git a/src/terminal/Selection.zig b/src/terminal/Selection.zig index aad69c6f27..452643f92e 100644 --- a/src/terminal/Selection.zig +++ b/src/terminal/Selection.zig @@ -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(); diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index 0633689605..bfe288d00e 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -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 diff --git a/src/terminal/osc.zig b/src/terminal/osc.zig index bc80763244..5aedaa6e06 100644 --- a/src/terminal/osc.zig +++ b/src/terminal/osc.zig @@ -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 diff --git a/src/terminal/page.zig b/src/terminal/page.zig index b396493fe9..18a5601b76 100644 --- a/src/terminal/page.zig +++ b/src/terminal/page.zig @@ -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 diff --git a/src/terminal/point.zig b/src/terminal/point.zig index 04eb6b10c9..12b71014bc 100644 --- a/src/terminal/point.zig +++ b/src/terminal/point.zig @@ -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, diff --git a/src/terminal/ref_counted_set.zig b/src/terminal/ref_counted_set.zig index d5c90bd6fd..2032f641d8 100644 --- a/src/terminal/ref_counted_set.zig +++ b/src/terminal/ref_counted_set.zig @@ -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. diff --git a/src/terminal/stream.zig b/src/terminal/stream.zig index ee609e3782..a9c8029657 100644 --- a/src/terminal/stream.zig +++ b/src/terminal/stream.zig @@ -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 { diff --git a/src/termio/shell_integration.zig b/src/termio/shell_integration.zig index 99aec848af..7a8726b15e 100644 --- a/src/termio/shell_integration.zig +++ b/src/termio/shell_integration.zig @@ -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); } diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000000..2d2813d4c1 --- /dev/null +++ b/typos.toml @@ -0,0 +1,41 @@ +[files] +extend-exclude = [ + "vendor/*", + "pkg/*", + "src/stb/*", + "*.xib", + # Do not self-check + "typos.toml", + # Fonts + "*.ttf", + "*.otf", + # Images + "*.png", + "*.ico", + "*.icns", + # Other + "*.pdf", + "*.data" +] + +[default] +extend-ignore-re = [ + # Ignore typos in test expectations + "testing\\.expect[^;]*;", + "kHOM\\d*" +] + +[default.extend-words] +Pn = "Pn" +thr = "thr" +# Should be "halves", but for now skip it as it would make diff huge +halfs = "halfs" +# Swift oddities +Requestor = "Requestor" +iterm = "iterm" +ACCES = "ACCES" +wdth = "wdth" +Strat = "Strat" + +[type.swift.extend-words] +inout = "inout" diff --git a/website/app/vt/bs/page.mdx b/website/app/vt/bs/page.mdx index ab8285957a..8fe1b01676 100644 --- a/website/app/vt/bs/page.mdx +++ b/website/app/vt/bs/page.mdx @@ -4,6 +4,6 @@ import VTSequence from "@/components/VTSequence"; -This sequence performs [cursor backword (CUB)](/vt/cub) +This sequence performs [cursor backward (CUB)](/vt/cub) with `n = 1`. There is no additional or different behavior for using `BS`. diff --git a/website/app/vt/cbt/page.mdx b/website/app/vt/cbt/page.mdx index 11ed989396..d5dd4d8905 100644 --- a/website/app/vt/cbt/page.mdx +++ b/website/app/vt/cbt/page.mdx @@ -8,7 +8,7 @@ Move the cursor `n` tabs left. The leftmost valid column for this operation is the first column. If [origin mode](#TODO) is enabled, then the leftmost valid column for this -operatin is the [left margin](#TODO). +operation is the [left margin](#TODO). Move the cursor left until the cursor position is on a tabstop. If the cursor would move past the leftmost valid column, the cursor remains at diff --git a/website/app/vt/cup/page.mdx b/website/app/vt/cup/page.mdx index 75e504d8fe..1a6c3c5a69 100644 --- a/website/app/vt/cup/page.mdx +++ b/website/app/vt/cup/page.mdx @@ -15,7 +15,7 @@ and the leftmost column on the screen is column 1. This sequence always unsets the pending wrap state. If [origin mode](#TODO) is **NOT** set, the cursor is moved exactly to the -row and column specified by `y` and `x`. The maxium value for `y` is the +row and column specified by `y` and `x`. The maximum value for `y` is the bottom row of the screen and the maximum value for `x` is the rightmost column of the screen. diff --git a/website/app/vt/dch/page.mdx b/website/app/vt/dch/page.mdx index 4cef1633d7..3cb5b5278d 100644 --- a/website/app/vt/dch/page.mdx +++ b/website/app/vt/dch/page.mdx @@ -22,7 +22,7 @@ differs from [Insert Character (ICH)](/vt/ich). Only cells within the scroll region are deleted or shifted. Cells to the right of the right margin are unmodified. -The blank cells inserted from the right margin are blank with the backgroud +The blank cells inserted from the right margin are blank with the background color colored according to the current SGR state. If a multi-cell character (such as "橋") is shifted so that the cell is split