Skip to content

Wrongly guessed shiftwidth #100

@oToToT

Description

@oToToT

I just found that vim-sleuth will set shiftwidth to 36 with the below example:

#include <span>
#include <vector>

template <typename T, typename Cmp = std::less<T>>
std::vector<int> get_cartesian_tree(std::span<T> sequence,
                                    auto &&cmp = Cmp{}) {
  std::vector<int> parents(sequence.size());
  int a;
  int b;
  int c;
  return parents;
}

template <typename T, typename Cmp = std::less<T>>
std::vector<int> get_cartesian_tree(const std::vector<T> &sequence,
                                    auto &&cmp = Cmp{}) {
  int d;
  int e;
  int f;
  return get_cartesian_tree(sequence, std::move(cmp));
}

I think it's sensible for human to guess the intended shiftwidth is 2.

I would happy if vim-sleuth can handle this scenario.

Still thanks for the nice plugin :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions