🐛 fix(vscode): 代码阅读按 ⌘↓ 跳高亮不再来回闪,筛选栏加上上一处、下一处
This commit is contained in:
1 parent
70a53e5a68
commit
b16cc6409e
8 files changed
+221
-36
No files matched your search
@@ -37,11 +37,17 @@ describe('跳到下一处 / 上一处高亮:package.json 里的命令和快捷
|
||||
])
|
||||
})
|
||||
|
||||
it('键只在 package.json 里绑,扩展、页面的代码里都不写死键:用户改绑后原来的键照常', () => {
|
||||
it('扩展端不写死键,跳转仍等命令消息。页面只认出默认的 ⌘↓ / ⌘↑(Windows 是 ctrl),取消浏览器滚到底 / 滚到顶,但不停事件继续传', () => {
|
||||
const sources = ['occurrenceNavigation.ts', 'previewEditor.ts', 'messages.ts', '../index.ts'].map(file => readFileSync(path.resolve(__dirname, file), 'utf8'))
|
||||
const webview = ['occurrences.ts', 'useOccurrences.ts', 'types.ts'].map(file => readFileSync(path.resolve(__dirname, '../../../webview-ui/src/codeReader', file), 'utf8'))
|
||||
for (const text of [...sources, ...webview])
|
||||
const types = readFileSync(path.resolve(__dirname, '../../../webview-ui/src/codeReader/types.ts'), 'utf8')
|
||||
for (const text of [...sources, types])
|
||||
expect(text).not.toMatch(/ArrowDown|ArrowUp|cmd\+|ctrl\+|KeyCombo|keybindings|preventDefault/)
|
||||
const page = ['occurrences.ts', 'useOccurrences.ts'].map(file => readFileSync(path.resolve(__dirname, '../../../webview-ui/src/codeReader', file), 'utf8'))
|
||||
expect(page.join('\n')).toMatch(/ArrowDown/)
|
||||
expect(page.join('\n')).toMatch(/ArrowUp/)
|
||||
expect(page.join('\n')).toContain('preventDefault()')
|
||||
expect(page.join('\n')).not.toContain('stopPropagation')
|
||||
expect(page.join('\n')).toContain('move(msg.step, true)')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user