The data-sidebar-idx of the currently vim-highlighted sidebar row (or null).
(client)
| 156 | } |
| 157 | /** The data-sidebar-idx of the currently vim-highlighted sidebar row (or null). */ |
| 158 | function cursorState(client) { |
| 159 | return evaluate(client, `(() => { |
| 160 | const el = [...document.querySelectorAll('[data-sidebar-idx]')].find(e => /(^|\\s)vim-cursor/.test(e.className)); |
| 161 | if (!el) return null; |
| 162 | const r = el.getBoundingClientRect(); |
| 163 | return { idx: Number(el.getAttribute('data-sidebar-idx')), tag: el.tagName, type: el.dataset.sidebarType, |
| 164 | text: (el.textContent || '').trim().length, inView: r.top >= -40 && r.bottom <= window.innerHeight + 40 }; |
| 165 | })()`) |
| 166 | } |
| 167 | |
| 168 | async function main() { |
| 169 | await prepareBuild() |