🐛 fix(vscode): 代码阅读预览记住浏览位置,编辑 / 预览互切位置对齐
This commit is contained in:
1 parent
6897954644
commit
37306bd23e
13 files changed
+409
-37
No files matched your search
@@ -15,12 +15,18 @@ export interface DocumentMessage {
|
||||
translators: TranslatorOption[]
|
||||
translatorId: string
|
||||
error?: string
|
||||
/** 从文本编辑器切过来时它顶部那一行:新预览只在第一份 document 里带,webview 滚到包含这行的块 */
|
||||
revealLine?: number
|
||||
}
|
||||
|
||||
export type ExtensionToWebview = DocumentMessage
|
||||
|
||||
/** edit:把 startLine..endLine 这几行整行替换成 text(扩展端给每行补回原来的缩进) */
|
||||
/**
|
||||
* edit:把 startLine..endLine 这几行整行替换成 text(扩展端给每行补回原来的缩进)
|
||||
* visibleLine:预览视口顶部那块的起始行,切回文本编辑器时把这行放到顶部
|
||||
*/
|
||||
export type WebviewToExtension
|
||||
= | { type: 'ready' }
|
||||
| { type: 'edit', startLine: number, endLine: number, text: string }
|
||||
| { type: 'selectTranslator', id: string }
|
||||
| { type: 'visibleLine', line: number }
|
||||
Reference in new issue
Block a user