Strange behavior of FindTabStyle (.vimrc)

#1 · closed · 1 comments

View on GitHub ↗

gabrfarina

Hi Marco, I noticed that the vim function FindTabStyle has some strange behavior. Specifically, I opened vim on a cpp file that looked like this: ``` #include <...> int SomeFunction() { if (some_condition) { // code } // code } ``` FindTabStyle sets tab expansion to 4 spaces, which is wrong. After some digging in the vimrc file I found out where things go wrong: https://github.com/melver/conf/blob/master/.vimrc#L117 I was wondering why you check that line does not match the prev_line regex. Removing that check fixes the problem.

Comments

melver

Thanks for spotting this. See commit for explanation for initial reason -- unfortunately the change to properly handle class declarations (commit 224e7a9a) broke the case you describe. The latest commit fixes this.