【问题标题】:Is there a function in Visual Studio Code that behaves the same as the `onDidChangeScrollTop` in Atom editor?Visual Studio Code 中是否有与 Atom 编辑器中的 `onDidChangeScrollTop` 行为相同的函数?
【发布时间】:2017-06-11 05:51:20
【问题描述】:

我正在为 vscode 构建一个 markdown 预览扩展,我需要跟踪编辑器的 scrollTop 位置。我查看了 vscode.d.ts 文件,但找不到任何 API。

还有,有没有办法获取编辑器的屏幕行。现在我只能得到缓冲区行。

谢谢你:)

【问题讨论】:

    标签: visual-studio-code vscode-extensions


    【解决方案1】:

    不,但这是在 VSCode API 中跟踪暴露视口信息的问题:https://github.com/Microsoft/vscode/issues/588


    另外,作为 VS Code 的 markdown 扩展的维护者,我很想知道您认为现有的 markdown 预览缺少哪些功能。有一个提议的 API 允许扩展来扩展内置的 Markdown 预览:https://github.com/Microsoft/vscode/issues/22916 也许这将是实现您所追求的更简单的方法?

    随时file an issue with more information about your use caseping me on twitter

    【讨论】:

    • 嗨!我正在尝试将我为Atom editor 编写的名为 Markdown Preview Enhanced 的扩展移植到 vscode,因为有些人要求它。我刚刚在visual studio marketplace上发布了一个可行的版本,有兴趣的可以去看看。我正在尝试在vscode中实现自动滚动同步,但是我找不到相关的API。因此,我想我会等待视口 API 支持。谢谢!
    猜你喜欢
    • 2015-07-14
    • 2015-08-03
    • 1970-01-01
    • 1970-01-01
    • 2021-10-06
    • 1970-01-01
    • 2015-07-10
    • 1970-01-01
    • 2020-01-16
    相关资源
    最近更新 更多