-
Notifications
You must be signed in to change notification settings - Fork 73
Sometimes tab inserts spaces, even with soft tabs off #11
Comments
Please fix it! |
"Is your use case that you want to open a buffer containing soft tabs and still insert hard tabs? Or vice versa?" Yes because in PHPDOC Block format the comments are sometimes pushed forward a little with a single space (for alignment) like so: /* |
Please fix. This is very annoying when working with a team. |
I hate to add a +1, but this doesn't seem to be going anywhere and I'm going to have to go back to Sublime Text 2 when working on a js project that uses tabs by default, and FYI it absolutely seems to relate to the use of PHP/Javadoc style block format being used, that have a leading space in them. |
+1 |
+1 from me as well. This annoys me to no end. |
+1 |
+1 |
I'm also having this problem with the javascript editor on Ubuntu. I can't copy and paste tabs, and when I press the tab key to further indent a line that is already indented with tabs, it adds the new indent in spaces plus enough spaces to eqaul the tab amount, as if the tabs weren't there, ie with tabs set to 2 spaces a press of the tab key changes \t\t to \t\t...... |
Yes @mer10z it's very annoying. The editor works well when there are no comments in the code, as someone pointed earlier.
*/ And you try to use tabs, you get spaces. |
+1 |
Can someone post a file that reproduces this issue? I would have thought a previous fix that ignores comment blocks for purposes of determining the tab setting would fix this: https://github.com/atom/atom/blob/master/src/editor.coffee#L326 Are you guys having issues editing files with mixed tab styles? |
This is related to atom/atom#2045. |
@nathansobo |
@nathansobo
You can find an example file that I see exhibiting problem 1 here: https://raw.githubusercontent.com/iandotkelly/atomissue/master/sample.js If I select any line here and hit tab, it inserts 4 spaces (or two spaces if its also exhibiting problem described above). I have atom@0.99 installed - I have soft tabs off. Thanks for showing an interest in my issue - atom would be fantastic if it wasn't for these issues I am seeing. Should I just nuke atom and start again? |
@iandotkelly The file works fine for me in .99. I am able to tab anywhere and it will use tabs instead of spaces. Additionally I have been going back and fixing all of the files atom forced spaces upon me in and they are also using tabs now |
@tm1000 - I guess I will be removing Atom and re-installing then - thanks for trying to replicate my issue though, most appreciated! |
@tm1000 - so I deleted Atom (from the finder) and deleted my ~/.atom folder and re-installed. Still have the problem! |
@nathansobo & @tm1000 - if I delete the comment block from my code, save the file and reopen it - tabs start working. If I then replace the comment block back into the code - the soft-tabs behaviour comes back. I've deleted Atom and downloaded .99 again, and deleted ~/.atom - which is confirmed by me losing all my packages, themes etc. I have a straightforward setup on my Mac - OSX Mavericks, and I run node.js for development. |
@iandotkelly Tabs vs Softtabs is determined when the file is first opened (or at least it was when @GameGamer43 did the PR) so I saved your file and then opened it from Atom. I didn't copy and paste anything When I copy and paste the comment block all spaces are removed from the comment block so it's rather hard for me to test that element, this could be the result of a plugin as I have several that deal with soft/hard tabs when reading vim configurations from files. But at least we've narrowed it down for you which might help @nathansobo |
@TM100 yes - I see that, the behavior of Atom only changes when I save quit and reopen the file. This behavior implies that it is still the comment block that is causing the problem. I've got used to using such blocks, but if it would fix my issue I would change. |
@iandotkelly I found the problem! The isComment method on Tokenized line https://github.com/atom/atom/blob/0ad26c337a35cccf7f645ae05e71aab5841f9fbc/src/tokenized-line.coffee#L143 isn't returning the correct value for javascript block comments. Since this is an Atom core bug I've closed this issue and moved it to atom/atom#2421 |
@probablycorey - Hey that's great news. Thanks! |
@probablycorey This didn't fix me (see http://discuss.atom.io/t/sometimes-tab-inserts-spaces-even-with-soft-tabs-off/3976/21). Should I open a new issue? |
@chamons are you looking for a config option that turns off automatic tab style detection? I think this might be a valid config option, but I'd like to know more about the problems the automatic detection is causing. Could you create a gist or point me to a sample file that exhibits the behavior you want fixed. |
This is a very bad thing when editing Makefiles. |
@Th0masR0ss can you send me an example of the Makefile where the tab setting is incorrectly detected? |
I'm having trouble making the issue reproduce outside my project. I can take a file where detection is incorrect, copy paste and save it somewhere else with the same name, open that file up and tab "works", while it is still broken locally. I'd love an option to just force tab to output actual tab characters and stop guessing. |
@chamons - I hear you. I get atom into all sort of strange states switching between projects that use tabs, and projects that use spaces. I would like to be able to force it rather than it guessing. |
@nathansobo Sorry, the problem was I was still using 0.95. I've updated, and it works now, however there was one case where Atom used soft tabs even though I told it not to but I can't reproduce it anymore. |
I |
This issue should be moved to atom/atom now anyway because usesSoftTabs is in the Editor class. |
You can toggle soft-tab on/off on an individual editor using the |
Problem still here why is this close? I'm trying to find and replace all space to tabs, and right after I replace all, atom change it right back to space.... |
Same problem as @KevinMcCoy wrote |
I also still have the problem. This makes Atom not usable for me. |
This has also been causing a lot of issues with the team I'm on. I'm likely to switch back to Sublime now. |
Why is this marked as closed? This error persists. |
Hey guys, A quick & easy fix is to install auto-detect-indentation |
You folks can set these settings:
and
You can scope them to languages The auto-detection result will persist after manually replacing all tabs with another tab type. So if you replace them all, reload the file or set the |
http://discuss.atom.io/t/sometimes-tab-inserts-spaces-even-with-soft-tabs-off/3976
The text was updated successfully, but these errors were encountered: