MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isAtStartOfMessage

Method isAtStartOfMessage

packages/pi-tui/src/components/editor.ts:2155–2160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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("/");

Callers 1

insertCharacterMethod · 0.95

Calls 1

isSlashMenuAllowedMethod · 0.95

Tested by

no test coverage detected