(anchor: HTMLElement)
| 1079 | } |
| 1080 | |
| 1081 | function 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 | |
| 1095 | interface ExCompletionMatch { |
| 1096 | label: string |
no outgoing calls
no test coverage detected