Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrongly guessed shiftwidth #100

Open
oToToT opened this issue Dec 27, 2024 · 0 comments
Open

Wrongly guessed shiftwidth #100

oToToT opened this issue Dec 27, 2024 · 0 comments

Comments

@oToToT
Copy link

oToToT commented Dec 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant