Coder Social home page Coder Social logo

Comments (41)

WooD1k avatar WooD1k commented on June 17, 2024

Please fix it!

from text-buffer.

chamons avatar chamons commented on June 17, 2024

See http://discuss.atom.io/t/sometimes-tab-inserts-spaces-even-with-soft-tabs-off/3976/11

from text-buffer.

tm1000 avatar tm1000 commented on June 17, 2024

"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:

/*
*
Atom interprets that as "oh you have a space so everything will be spaces" which is annoying if the actual file is hard tabs.

from text-buffer.

sethburtonhall avatar sethburtonhall commented on June 17, 2024

Please fix. This is very annoying when working with a team.

from text-buffer.

iandotkelly avatar iandotkelly commented on June 17, 2024

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.

from text-buffer.

maurociancio avatar maurociancio commented on June 17, 2024

+1

from text-buffer.

lord2800 avatar lord2800 commented on June 17, 2024

+1 from me as well. This annoys me to no end.

from text-buffer.

sookcha avatar sookcha commented on June 17, 2024

+1

from text-buffer.

holzmann avatar holzmann commented on June 17, 2024

+1
Switched back to Sublime Text 3 because of this behavior.

from text-buffer.

mer10z avatar mer10z commented on June 17, 2024

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......

from text-buffer.

maurociancio avatar maurociancio commented on June 17, 2024

Yes @mer10z it's very annoying. The editor works well when there are no comments in the code, as someone pointed earlier.
For example, if i have:
/**

  • comment with spaces

*/

And you try to use tabs, you get spaces.

from text-buffer.

 avatar commented on June 17, 2024

+1

from text-buffer.

nathansobo avatar nathansobo commented on June 17, 2024

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?

from text-buffer.

probablycorey avatar probablycorey commented on June 17, 2024

This is related to atom/atom#2045.

from text-buffer.

tm1000 avatar tm1000 commented on June 17, 2024

@nathansobo
For me this issue has been completely resolved with something you fixed within the .90 - .99 releases so I haven't run across any file that has the issue. I wasn't sure if it was a fluke or not until your comment right now.

from text-buffer.

iandotkelly avatar iandotkelly commented on June 17, 2024

@nathansobo
The problems that I have are:

  1. (This problem) Where it inserts spaces instead of tabs even though I have soft-tabs off
  2. When I start atom, some files come up with 2 space tabs, even though I have it set to 4
  3. I regularly see tab stops not lining up on adjacent lines.

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 [email protected] 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?

from text-buffer.

tm1000 avatar tm1000 commented on June 17, 2024

@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

from text-buffer.

iandotkelly avatar iandotkelly commented on June 17, 2024

@tm1000 - I guess I will be removing Atom and re-installing then - thanks for trying to replicate my issue though, most appreciated!

from text-buffer.

iandotkelly avatar iandotkelly commented on June 17, 2024

@tm1000 - so I deleted Atom (from the finder) and deleted my ~/.atom folder and re-installed. Still have the problem!

from text-buffer.

iandotkelly avatar iandotkelly commented on June 17, 2024

@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.

from text-buffer.

tm1000 avatar tm1000 commented on June 17, 2024

@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

from text-buffer.

iandotkelly avatar iandotkelly commented on June 17, 2024

@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.

from text-buffer.

probablycorey avatar probablycorey commented on June 17, 2024

@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

from text-buffer.

iandotkelly avatar iandotkelly commented on June 17, 2024

@probablycorey - Hey that's great news. Thanks!

from text-buffer.

chamons avatar chamons commented on June 17, 2024

@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?

from text-buffer.

probablycorey avatar probablycorey commented on June 17, 2024

@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.

from text-buffer.

thomassross avatar thomassross commented on June 17, 2024

This is a very bad thing when editing Makefiles.

from text-buffer.

nathansobo avatar nathansobo commented on June 17, 2024

@Th0masR0ss can you send me an example of the Makefile where the tab setting is incorrectly detected?

from text-buffer.

chamons avatar chamons commented on June 17, 2024

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.

from text-buffer.

iandotkelly avatar iandotkelly commented on June 17, 2024

@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.

from text-buffer.

thomassross avatar thomassross commented on June 17, 2024

@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.

from text-buffer.

thomassross avatar thomassross commented on June 17, 2024

I second third @chamons's idea to have a "force hard tabs" option

from text-buffer.

thomassross avatar thomassross commented on June 17, 2024

This issue should be moved to atom/atom now anyway because usesSoftTabs is in the Editor class.

from text-buffer.

probablycorey avatar probablycorey commented on June 17, 2024

You can toggle soft-tab on/off on an individual editor using the editor:toggle-soft. But this setting won't persist after the editor is closed. This issue is obviously annoying for some people, so someone could open this issue on the atom repo with a description of how they expect it to behave that would be great!

from text-buffer.

KevinMcCoy avatar KevinMcCoy commented on June 17, 2024

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....

from text-buffer.

bananavoid avatar bananavoid commented on June 17, 2024

Same problem as @KevinMcCoy wrote

from text-buffer.

rinux55 avatar rinux55 commented on June 17, 2024

I also still have the problem. This makes Atom not usable for me.

from text-buffer.

James-Firth avatar James-Firth commented on June 17, 2024

This has also been causing a lot of issues with the team I'm on. I'm likely to switch back to Sublime now.

from text-buffer.

MattWilcox avatar MattWilcox commented on June 17, 2024

Why is this marked as closed? This error persists.

from text-buffer.

thomassross avatar thomassross commented on June 17, 2024

Hey guys,

A quick & easy fix is to install auto-detect-indentation

from text-buffer.

benogle avatar benogle commented on June 17, 2024

You folks can set these settings:

screen shot 2016-01-25 at 2 50 04 pm

core.tabType in config.cson

and

screen shot 2016-01-25 at 2 50 11 pm

core.softTabs in config.cson

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 tabType setting to the type you want.

from text-buffer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.