IDE - Divergence between Ides relative to tab [to Enter]

Asked

Viewed 464 times

8

On grounds of hadware, I am the only one in my team that is using Sublime Text 3, the others are using Eclipse Luna or Mars, until there is nothing more.

However since the exchange I’ve had some problems in the commit, because my achievements have started to get divergent in several lines, and when I go to check what it is, it is only about the spacing tab.

I have already checked the question of tab-size, both this with 4, and the encoding both are with UTF-8.

There would be some other configuration that could cause this divergence?

I think if that were the case encode should not cause error in the spacing of the whole aquifer instead of just a few fragments?

Editing

I was checking the commits again and then I found the option, ShowWhiteSpace Characters in the eclipse.

And in the line in which errors are occurring there is this peculiarity :

inserir a descrição da imagem aqui

As you can see at the end of the line there ¤, Does anyone know what character this is? And what is it for? It is set when I give enter in the eclipse.

  • 3

    Confirm if Eclipse is converting spaces to tabs or if it is the sublime that is doing this.

  • 1

    Prefer to always use spaces instead of \t, avoids this kind of problem.

  • 1

    Everyone there uses the same S.O?

  • 2

    @Luishenrique disagree, what has q be done is an alignment of the pattern, regardless of what it is, eclipse for example uses by default tabulation, already the sublime uses by default spaces, so instead of everyone who uses tabulation switching to space it would be interesting to configure the sublime to use tabulation, since it is the only one to use sublime.

  • 2

    @gmsantos no Eclipse Preferences->General->Editors->Text Editors the option insert space for tabs this cleared, and in Preferences->PHP->Code Style->Formatter I’m using PHP convention in which tab policity = Tab. In the sublime translate_tabs_to_spaces = false.

  • 2

    @Guilhermelautert I do not use either, I only commented conceptually what the problem may be.

Show 1 more comment

3 answers

3


This divergence occurs in the snippets you edit from the file on Sublime ?

In the eclipse there is a setting to remove the one whiteSpace. You going into Preference -> [linguagem, por exemplo JAVA] -> Editor -> Save Action, check in Perform the selected actions on save, afterward Additional actions. Then click on Configure... and on the tab Code Organizing check the option Remove trailing whitespace.

Also you can configure to display these characters. Just go to Preference -> General -> Editors -> Text Editors and on the option Show whitespace character (must be marked) has a link configure visibility. Clicking will open a screen for you to mark the characters you want to view at different positions in the code. To the space (or any other you want) check the option trailing. Restart the eclipse and make sure the problem keeps happening.

  • 1

    Through your answer I found the problem, seeing the symbol that the eclipse uses to \r, which would be precisely that of my "issue in question", in which I knew as LF, in this way I saw that the only problem is the divergence between Linux and Windows, in which Linux uses only CR (\n) and Windows LF CR (\r\n).

3

You can configure your editor to use the tab pattern, the default options used by the editor by accessing the menu Sublime Text > Preferences > Settings - Default. All these options can be customized through the menu Settings - User.

{"translate_tabs_to_spaces": false}: converte espaços em tab.
  • 1

    the default setting is already this way, but thanks and help.

2

All you have to do is use: http://editorconfig.org/

simply configure a file .editorconfig at the root of your project, install the plugin for your respective IDE and you’re done! all will have the same configuration.

  • I appreciate the recommendation, I’ll suggest to the rest of the team.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.