From 3e136122ecdc674e611016f5936b73bef3d26b01 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 8 Nov 2026 22:07:12 -0300 Subject: helix: %S\s+ keeping the line's newline in its last piece is a documented pardes choice, waived in words: helix's split_on_matches (helix-core/src/selection.rs:852-880) runs the Rust regex over the whole range, whose \s matches the newline at 14, so the last piece ends at 13, where pardes searches as sam does, line by line (reference.typ, Regular expressions; src/regexp.zig), and \s never reaches a newline unless the pattern names \n (S\s+|\n gives helix's pieces, checked against hx-harness); waivers.jsonl names split-regex-ws and split-regex-ws-tty (hxdiff 2 to 0), reference.typ adds \s to what never matches a newline, and helix-keys.md has its row Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- docs/typ/reference.typ | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/typ/reference.typ') diff --git a/docs/typ/reference.typ b/docs/typ/reference.typ index b1532424..48bdfdbe 100644 --- a/docs/typ/reference.typ +++ b/docs/typ/reference.typ @@ -719,7 +719,8 @@ over the match where the search starts. Patterns are mvzr's (classes, `\d\w\s`, `{m,n}`, lazy `*?`), searched as sam searches, line by line: `^` and `$` match at any line's start and end, -`.` and `[^...]` never match a newline. The same code (`src/regexp.zig`) +`.`, `\s` and `[^...]` never match a newline (helix's `\s` and `[^...]` do: +there `S\s+` splits off a line's newline, here `S\s+|\n` does). The same code (`src/regexp.zig`) serves addresses, #word("Edit"), and normal mode's #key("s") and #key("S"). The ceiling: -- cgit v1.3