Problem indenting Markdown


#1

Hi there everybody, my first post, shame it’s for reporting a problem.

  1. Atom 1.0.11
  2. OS X 10.10.5
  3. Steps to reproduce

Go to Settings and mark:

  • Soft tabs
  • Tab Length
  • And set the Tab length dropdown menu to 2
  • Also in the package language-gfm I set Tab Length to 2.
  1. Expected When editing a markdown file hiting the Tab key and getting a soft-tab of 2 spaces. And also when indenting with Cmd+] getting 2 spaces too.
  2. Actual I always get a soft-tab of 4 spaces.

#2

I could not reproduce the issue using Atom v1.0.12-9a129c2 on Mac OS X 10.10.5. What I did:

  1. Opened Settings View
  2. Verified that Tab Type was set to soft
  3. Verified that Tab Length was set to 2
  4. Went to settings for language-gfm package
  5. Changed Tab Length to 2
  6. Closed Settings View
  7. Created new file with Cmd+N
  8. Saved file as foo.md
  9. Typed # Test on the first line
  10. Pressed Return twice
  11. Started pressing Tab

Each time Tab was pressed, two spaces were inserted.

Also, my indentation-indicator package showed the indentation settings for the editor to be “Spaces:2”.

Could it be that you already had the Markdown file open and the new setting didn’t take effect?


#3
  1. I tried exactly what you did and got the exact same results. Good.
  2. I tried again with my old markdown file and nothing.
  3. Installed your package, and the indicator on my old file said 4 all the time, even though I hadn’t any line indented.
  4. But, after a while the indicator changed to 2. Conclusion, man, your package it’s awesome! Are they gonna include it in the core?

And now, I restarted Atom several times, and the setting wasn’t taking effect.
So, thanks, issue solved, and lightning fast response, wow.


#4

There have been suggestions to integrate it into core. I believe there is a PR to add something similar, but I can’t find it right now.


#5

Well, they should. That’s a basic but essential feature. I think you could improve it, if the indicator was clickable, and the type of indentation could be set from there, just saying :wink: Yeah, you know, like that other awesome code editor that a lot of people use.
No seriously, thanks.


#6

Yes, that’s been a request for a while. I haven’t had the time to work on it though. I’m taking vacation from work in a couple weeks, perhaps I’ll have a chance then.


#7

Maybe tab-control is what you’re looking for?