From 69a8ecd5b37fdde6eb2b93b78a3c7feefb54bec0 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sat, 3 Jan 2026 15:44:36 +0100 Subject: [PATCH] fix: slash command autocomplete triggers for . - _ prefixes fixes #422 --- packages/tui/CHANGELOG.md | 4 ++++ packages/tui/src/components/editor.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/tui/CHANGELOG.md b/packages/tui/CHANGELOG.md index 7a5b3028..c7e775bb 100644 --- a/packages/tui/CHANGELOG.md +++ b/packages/tui/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Slash command autocomplete now triggers for commands starting with `.`, `-`, or `_` (e.g., `/.land`, `/-foo`) ([#422](https://github.com/badlogic/pi-mono/issues/422)) + ## [0.32.1] - 2026-01-03 ## [0.32.0] - 2026-01-03 diff --git a/packages/tui/src/components/editor.ts b/packages/tui/src/components/editor.ts index c5765162..82e849a3 100644 --- a/packages/tui/src/components/editor.ts +++ b/packages/tui/src/components/editor.ts @@ -834,7 +834,7 @@ export class Editor implements Component { } } // Also auto-trigger when typing letters in a slash command context - else if (/[a-zA-Z0-9]/.test(char)) { + else if (/[a-zA-Z0-9.\-_]/.test(char)) { const currentLine = this.state.lines[this.state.cursorLine] || ""; const textBeforeCursor = currentLine.slice(0, this.state.cursorCol); // Check if we're in a slash command (with or without space for arguments)