From 2504b38647653db091aa7709afcea0dbe75f7a95 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:31:19 -0300 Subject: normal, modal, File, edit: small ones: tryFind inlined (its clamp never bound), the smart-case haystack is allocLowerString, the two WordTargets nothing produces go, File.lineCount is modal.cursorLineCount's alias, and pasteRegister and ClipRequest share one Paste enum Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/File.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/File.zig') diff --git a/src/File.zig b/src/File.zig index ad76909d..43eccc49 100644 --- a/src/File.zig +++ b/src/File.zig @@ -589,9 +589,7 @@ test "the ASCII run in fitEnd cuts where the grapheme walk would" { } } -pub fn lineCount(content: []const u8) usize { - return std.mem.count(u8, content, "\n") + 1; -} +pub const lineCount = modal.cursorLineCount; // Content changes invalidate this lazily rebuilt byte-offset index. pub fn lineIndex(gpa: std.mem.Allocator, f: *State) ![]const usize { -- cgit v1.3