tpope / vim-sleuth

sleuth.vim: Heuristically set buffer options
https://www.vim.org/scripts/script.php?script_id=4375
1.92k stars 86 forks source link

shiftwidth for commit messages is 22 #60

Closed jsatk closed 5 years ago

jsatk commented 5 years ago
Screen Shot 2019-07-09 at 10 40 43 AM

This seems incorrect and strange. Any idea how to get it to stop doing this?

FWIW I've had this plugin installed a long time. This behavior is new.

tpope commented 5 years ago

What's in the file?

jsatk commented 5 years ago

It's code for work so I can't show it here, but I pressed cvc from Fugitive's :Gstatus screen, opening up a verbose commit message window. Wondering if something in there threw it off. This doesn't happen every time, but seemingly randomly.

tpope commented 5 years ago

I'm not sure why you're surprised that the contents of the diff might affect the detection? You say "the behavior is new" but the plugin hasn't had any code changes in over a year so I'm not sure what you're basing that on.

Regardless, the first part of the solution is probably some sort of hard coded filetype blacklist.

jsatk commented 5 years ago

Thanks. I'm not sure how the plugin works. It's something I've just started noticing. Probably because I'm in a new repo and the code formatting is throwing Sleuth off and making it think 22 spaces is the shiftwidth I want.

Either way, not a bug. Thanks for following up.

On 07/10, Tim Pope wrote:

I'm not sure why you're surprised that the contents of the diff might affect the detection? You say "the behavior is new" but the plugin hasn't had any code changes in over a year so I'm not sure what you're basing that on.

Regardless, the first part of the solution is probably some sort of hard coded filetype blacklist.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/tpope/vim-sleuth/issues/60#issuecomment-510130928