szn

Bug 54 — split-window -h (exactly, no trailing args) maps to vertical split

54. split-window -h (exactly, no trailing args) maps to vertical split

File: src/key_binding.zig:432–440 Severity: MEDIUM Status: ❌ FALSE POSITIVE — condition correctly returns split_horizontal when flag is at end.

if (std.mem.startsWith(u8, trimmed, "split-window") or std.mem.startsWith(u8, trimmed, "splitw")) {
    if (std.mem.indexOf(u8, trimmed, " -h")) |idx| {
        const after = idx + 3;
        if (after >= trimmed.len or trimmed[after] == ' ') return .split_horizontal;
    }
    return .split_vertical;
}

For "split-window -h": idx = 12, after = 15, trimmed.len = 15. after >= trimmed.len is true → falls through to .split_vertical. So the exact bare command split-window -h returns .split_vertical. Only split-window -h <something> correctly returns .split_horizontal. Also, split-window -hv (combined flags) would not match " -h" since there’s no space before.