vim-sleuth icon indicating copy to clipboard operation
vim-sleuth copied to clipboard

Wrongly guessed shiftwidth

Open oToToT opened this issue 10 months ago • 0 comments
trafficstars

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 :)

oToToT avatar Dec 27 '24 20:12 oToToT