mad_utk
mad_utk

Reputation: 25

Netbeans Tab-space setting

Whenever I commit my code on bitbucket, My Tab-space indentation do not match with other Devlopers, Though Netbeans showing it with proper indentation. Is this problem of Netbeans tab setting or bitbucket? Is there any way we can provide Tab setting to change as per pulled file Tab setting?

Upvotes: 1

Views: 1029

Answers (1)

ollo
ollo

Reputation: 25350

This probably because you are using Tabs and the others expand those to spaces. The size of a tab differs somewhere between 2 and 8 spaces and this destroys any formatting.

Just set the option to expand Tabs to spaces and the problem is solved. You can use your IDE as usual, but the file will contain fixed spaces (eg. 4 spaces) instead of a hard tab ("\t").

To do this:

  1. Open Tools --> Options and go to Editor -> Formatting
  2. Language: All Languages
  3. Category: Tabs and Indents
  4. Select Expand Tabs to Spaces and a Number of spaces / Tab size of 4 (or whatever is used in your project)

You can check this by enabling View --> Show Non-Printable Characters. This should show bullets if spaces are used but some kind of arrow for Tabs.

Upvotes: 1

Related Questions