【问题标题】:How to make VSCode cursor macro instantanious?如何使 VSCode 光标宏瞬时?
【发布时间】:2021-09-25 04:01:31
【问题描述】:

我正在使用multi-command extension,在宏中粘贴一些文本后,我将光标移动了几次,如下所示:

{
    "command": "multiCommand.test",
    "interval": 0,
    "sequence":[
        {
            "command": "editor.action.insertSnippet",
            "args": {"snippet": "some text\n\n"}
        },
        {"command" : "cursorUp"},
        {"command" : "cursorUp"},
        {"command" : "cursorEnd"},
    ]
}

一切都结束了,但是光标执行这些命令时会有明显的延迟,我希望它是瞬时的(例如,我不想看到它通过每一步,而只是在正确的位置结束。 ) 是否有一些我可以更改的设置,或者我可以使用其他命令来指示光标移动到文本中的某个坐标?

【问题讨论】:

  • 这是即时的,因为您将使用多命令获得。它正在依次运行这些命令中的每一个,等待每个命令完成。有一个cursorMove 命令有时会有所帮助,请参阅code.visualstudio.com/api/references/commands 处的选项。

标签: visual-studio-code vscode-settings vscode-extensions


【解决方案1】:

在您的 sn-p 中添加字段 $0

"snippet": "some text$0\n\n"

并删除光标命令

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-25
    • 2020-10-17
    • 1970-01-01
    • 2021-08-20
    • 2015-10-08
    • 2021-11-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多