volgar1x / vim-gocode

A Go bundle for Vundle or Pathogen
237 stars 34 forks source link

Use tabs for formatting only based on expandtab setting #20

Closed sebnow closed 10 years ago

sebnow commented 10 years ago

The 'smarttab' option does not affect whether tabs or spaces are used for indentation, and thus should not be used to determine whether the -tabs flag should be used.

The 'smarttab' option only determines whether a at the in front of a line should align to the indentation level. From the documentation for 'smarttab':

What gets inserted (a <Tab> or spaces) depends on the 'expandtab'
option.

If 'smarttab' is enabled but 'expandtab' is disabled, the 'Fmt' command will not use tabs, which isn't the intended behaviour.

volgar1x commented 10 years ago

+1 seems good to me