ciaranm / detectindent

Vim script for automatically detecting indent settings
173 stars 48 forks source link

Consolidate applying indent settings #22

Open idbrii opened 9 years ago

idbrii commented 9 years ago

Move applying indent settings into a single function to ensure we set them consistently.

Currently, there's some variance between which settings are applied. This ensures we always set values consistently. I'm trying to make us follow the guidelines in :help tabstop.

This PR changes behavior to set expandtab when we find both tabs and spaces. That case sets tabstop after calling SetIndent which is a bit weird, but presumably the guessing behavior is more useful than forcing tabstop=8.

Also, set softtabstop=-1 on supported versions of vim.

idbrii commented 4 years ago

I found a bug with tabs-only files and added the fix to this PR.