鉴于我已经跑了
$ git worktree add ~/worktrees/a
$ cd ~/worktrees/a
$ git status
On branch a
Run Code Online (Sandbox Code Playgroud)
我想将工作树和分支的名称从 更改a为b。
我有一个旧的代码库,它使用奇怪的缩进样式。它使用制表符宽度 8,但缩进 4 个槽口,尽可能用制表符替换 8 个空格。
代码应如下所示:
____if (foo) {
TAB---->if (bar) {
TAB---->____something();
TAB---->}
____}
Run Code Online (Sandbox Code Playgroud)
我已经安装了EditorConfig for Visual Studio Code扩展,并且我的.editorconfig有:
root = true
[*]
insert_final_newline = true
indent_size = 4
tab_width = 8
Run Code Online (Sandbox Code Playgroud)
但现有的代码如下所示:
____if (foo) {
TAB>if (bar) {
TAB>____something();
TAB>}
____}
Run Code Online (Sandbox Code Playgroud)
当我添加 时indent_style = tab,现有代码看起来再次正确,但是当我键入新代码时,我得到以下结果:
____if (foo) { // after hitting Enter on this line the next line is indented too far:
TAB---->____something
____}
Run Code Online (Sandbox Code Playgroud)
如何实现所需的显示和缩进行为?
我见过这个代码:
template <class... TYPES>
constexpr void tuple<TYPES...>::swap(tuple& other)
noexcept((is_nothrow_swappable_v<TYPES> and ...))
{
for...(constexpr size_t N : view::iota(size_t(0), sizeof...(TYPES))) {
swap(get<N>(*this), get<N>(other));
}
}
Run Code Online (Sandbox Code Playgroud)
构造体有for...什么作用?