MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / positionWildmenu

Function positionWildmenu

packages/app-core/src/components/Editor.tsx:1081–1093  ·  view source on GitHub ↗
(anchor: HTMLElement)

Source from the content-addressed store, hash-verified

1079}
1080
1081function positionWildmenu(anchor: HTMLElement): void {
1082 if (!wildmenu) return
1083 const panel = anchor.closest('.cm-vim-panel') as HTMLElement | null
1084 const target = panel ?? anchor
1085 const rect = target.getBoundingClientRect()
1086 wildmenu.root.style.left = `${Math.max(8, Math.round(rect.left))}px`
1087 // Anchor above the ex panel (vim wildmenu convention). Keep at least 8px
1088 // from the top edge so it doesn't bump into the title bar.
1089 const bottom = Math.max(8, Math.round(window.innerHeight - rect.top) + 6)
1090 wildmenu.root.style.bottom = `${bottom}px`
1091 wildmenu.root.style.right = ''
1092 wildmenu.root.style.top = ''
1093}
1094
1095interface ExCompletionMatch {
1096 label: string

Callers 2

renderWildmenuFunction · 0.85
installExTabCompletionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected