We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fc4ce9 commit a7bf401Copy full SHA for a7bf401
webview-ui/src/utils/context-mentions.ts
@@ -1,7 +1,10 @@
1
import { mentionRegex } from "../../../src/shared/context-mentions"
2
import { Fzf } from "fzf"
3
import { ModeConfig } from "../../../src/shared/modes"
4
-import * as path from "path"
+
5
+function getBasename(filepath: string): string {
6
+ return filepath.split("/").pop() || filepath
7
+}
8
9
export interface SearchResult {
10
path: string
@@ -235,7 +238,7 @@ export function getContextMenuOptions(
235
238
return {
236
239
type: result.type === "folder" ? ContextMenuOptionType.Folder : ContextMenuOptionType.File,
237
240
value: formattedPath,
- label: result.label || path.basename(result.path),
241
+ label: result.label || getBasename(result.path),
242
description: formattedPath,
243
}
244
})
0 commit comments