Skip to content

Commit a3800a5

Browse files
samhvw8mrubens
andauthored
Update src/core/mentions/index.ts
Co-authored-by: Matt Rubens <[email protected]>
1 parent 8d6cd4a commit a3800a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/mentions/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function openMention(mention?: string, osInfo?: string): Promise<vo
2323
}
2424

2525
if (
26-
((osInfo === "unix" || osInfo === undefined) && mention.startsWith("/")) ||
26+
(osInfo !== "win32" && mention.startsWith("/")) ||
2727
(osInfo === "win32" && mention.startsWith("\\"))
2828
) {
2929
const relPath = mention.slice(1)
@@ -164,7 +164,7 @@ const fileHandler: HandlerConfig = {
164164
test: (mention: string, { osInfo }) => (osInfo !== "win32" ? mention.startsWith("/") : mention.startsWith("\\")),
165165
handler: async (mention, { cwd, osInfo }) => {
166166
let mentionPath = mention.slice(1)
167-
const isFolder = mention.endsWith("/")
167+
const isFolder = osInfo === "win32" ? mention.endsWith("\\") : mention.endsWith("/")
168168
const tag = createXmlTag(isFolder ? "folder_content" : "file_content", { path: mentionPath })
169169

170170
if (mentionPath.includes(" ")) {

0 commit comments

Comments
 (0)