格式化后光标位于一个奇怪的位置

时间:2018-12-29 05:51:29

标签: vue.js visual-studio-code prettier vetur

我的vscode配备了vetur插件。自定义配置如下:

#include <iostream>
#include <id3lib-3.8.3/include/id3/tag.h>
int main() { std::cout << "hi"; }

其他是默认配置

vetur版本号为main.cpp:2:46: fatal error: id3lib-3.8.3/include/id3/tag.h: No such file or directory #include <id3lib-3.8.3/include/id3/tag.h> ,vscode版本号为id3lib-3.8.3/include/id3/tag.h:32:30: fatal error: id3/id3lib_frame.h: No such file or directory #include <id3/id3lib_frame.h>


使用vuejs编程时,它可能写300多个行。按下格式化快捷方式后,光标不在格式化位置。它位于"vetur.format.options.tabSize": 2, "vetur.format.defaultFormatterOptions": { "js-beautify-html": { "wrap_attributes": "auto" }, "prettyhtml": { "printWidth": 10000, "singleQuote": false, "wrapAttributes": false, "sortAttributes": false } }, "vetur.format.defaultFormatter.html": "js-beautify-html" 标签的前面。这是非常痛苦的。现在,您必须每次都记住它。格式化位置的行数,然后跳回自己

1 个答案:

答案 0 :(得分:0)

 "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_line_length": 120,
            "wrap_attributes": "auto",
            "end_with_newline": false
        }
    },
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.js": "vscode-typescript",