()
| 2153 | |
| 2154 | // Helper method to check if cursor is at start of message (for slash command detection) |
| 2155 | private isAtStartOfMessage(): boolean { |
| 2156 | if (!this.isSlashMenuAllowed()) return false; |
| 2157 | const currentLine = this.state.lines[this.state.cursorLine] || ""; |
| 2158 | const beforeCursor = currentLine.slice(0, this.state.cursorCol); |
| 2159 | return beforeCursor.trim() === "" || beforeCursor.trim() === "/"; |
| 2160 | } |
| 2161 | |
| 2162 | private isInSlashCommandContext(textBeforeCursor: string): boolean { |
| 2163 | return this.isSlashMenuAllowed() && textBeforeCursor.trimStart().startsWith("/"); |
no test coverage detected