Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在打开预览的情况下编辑 HTML block,编辑器会乱滚乱跳 #1013

Closed
abecd opened this issue Sep 17, 2021 · 4 comments
Closed

在打开预览的情况下编辑 HTML block,编辑器会乱滚乱跳 #1013

abecd opened this issue Sep 17, 2021 · 4 comments
Labels
Area: Preview The Markdown preview is owned by VS Code. We have nearly no control. Res: External Outside of our control/codebase. Upstream Pertaining to an upstream component, or blocked by an upstream issue.

Comments

@abecd
Copy link

abecd commented Sep 17, 2021

Problem

在开头用html书写表格,在超出一页的地方为表格td添加内容时,编辑器会自动跳到头部但光标位置不变,经测试,只有当markdown文件和预览视图同时显示时才出现这种情况。

How to reproduce

bug

Configuration

默认配置

Environment

系统: win10
vscode: 1.60.1
插件: v3.4.0

@yzhang-gh
Copy link
Owner

请见 #961 (comment)

@Lemmingh Lemmingh added Area: Preview The Markdown preview is owned by VS Code. We have nearly no control. Res: External Outside of our control/codebase. Upstream Pertaining to an upstream component, or blocked by an upstream issue. labels Sep 17, 2021
@Lemmingh
Copy link
Collaborator

The problem here is exactly caused by VS Code's source map mechanism.

#961 involves other factors.

@Lemmingh Lemmingh changed the title 编辑器在书写html表格时自动跳转到头部 在打开预览的情况下编辑 HTML block,编辑器会乱滚乱跳 Sep 17, 2021
@abecd
Copy link
Author

abecd commented Sep 17, 2021

Thank you very much. You can close this issue.

@Lemmingh
Copy link
Collaborator

可以讲汉语。我那会儿只是手头的机器没法打字。


VS Code 在 editor 和 preview 之间分段线性映射,实现 scroll sync。但是在一些情况下,锚点太稀疏,所以会出现跳很远的问题。

如果点足够多,可以改善到几行内的抖动。完全不抖恐怕有些难,毕竟 scroll event 太容易发生,而且运算的精度问题可能在反馈中被放大。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Preview The Markdown preview is owned by VS Code. We have nearly no control. Res: External Outside of our control/codebase. Upstream Pertaining to an upstream component, or blocked by an upstream issue.
Projects
None yet
Development

No branches or pull requests

3 participants