Skip to content

Commit a90d455

Browse files
committed
Highlight slash commands
1 parent 52ad8e6 commit a90d455

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, us
22
import { useEvent } from "react-use"
33
import DynamicTextArea from "react-textarea-autosize"
44

5-
import { mentionRegex, mentionRegexGlobal, unescapeSpaces } from "@roo/context-mentions"
5+
import { mentionRegex, mentionRegexGlobal, commandRegexGlobal, unescapeSpaces } from "@roo/context-mentions"
66
import { WebviewMessage } from "@roo/WebviewMessage"
77
import { Mode, getAllModes } from "@roo/modes"
88
import { ExtensionMessage } from "@roo/ExtensionMessage"
@@ -718,6 +718,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
718718
.replace(/\n$/, "\n\n")
719719
.replace(/[<>&]/g, (c) => ({ "<": "&lt;", ">": "&gt;", "&": "&amp;" })[c] || c)
720720
.replace(mentionRegexGlobal, '<mark class="mention-context-textarea-highlight">$&</mark>')
721+
.replace(commandRegexGlobal, '<mark class="mention-context-textarea-highlight">$&</mark>')
721722

722723
highlightLayerRef.current.scrollTop = textAreaRef.current.scrollTop
723724
highlightLayerRef.current.scrollLeft = textAreaRef.current.scrollLeft

0 commit comments

Comments
 (0)