Hi @shd101wyy,
I've been using your markdown plugin for a few months and still can't stop wondering how awesome it is! Today I discovered the TOC feature and very much liked the fact that it's fully automated. Here is one little issue though. ATM my Atom is configured to use soft tabs, which means that when I press » the editor pastes two spaces ··:

Despite that, real tabs are being used inside TOC and this creates a bit of inconsistency:
According to toc.coffee, tabs are currently hardcoded.
Would it be possible to read the value from Atoms config instead? An ideal scenario would include integration with .editorconfig files, but I guess that even a small simple choice based on Atom's top-level preferences can make quite an improvement. What do you think @shd101wyy?
Thanks a lot for the plugin again!
Hi @kachkaev , thanks for your advice.
It seems this can be done very easily with the following code:
editor = atom.workspace.getActiveTextEditor() # current markdown editor
editor.getTabText() # get tab text
I am quite busy recently, so I might release a new version during thanksgiving break. But I will let you know if I do it earlier.
Thanks :)
Maybe an ability to choose between - and * for unordered lists would be good too. Although I was able to overcome linting problems like this:
<!-- lint disable unordered-list-marker-style list-item-indent -->
<!-- untoc -->
Table of Contents
---
<!-- table of contents is autogenerated by https://atom.io/packages/markdown-preview-enhanced Atom plugin -->
<!-- toc depthFrom:2 depthTo:4 -->
...
<!-- tocstop -->
<!-- lint enable unordered-list-marker-style list-item-indent -->
So - for unordered list and * for ordered list?
My markdown linting rules require the use of * instead of - for unordered lists – this way they look more distinct in the source code view. The rule is called unordered-list-marker-style. There is also another rule in my config, called ist-item-indent, which is set to tab-size.
Both of these rules are currently violated by the TOC so I get a massive array of red dots next to it in Atom by default. An ideal solution would be to make TOC configurable in terms of the length and the type of the offset (2 spaces, four spaces, one tab, etc.) as well as the type of the marker (* vs -).
Good news that the issue with linting can be prevented with those extra comments in my example above. However, this is a bit hacky.
Hi @kachkaev , should be done now.
Cheers.
Hi @shd101wyy, sorry for a slightly long reply.
Could you please clarify a bit how to configure the tabs? My atom uses spaces by default, but TOC still puts tabs and I can't seem to change this. The plugin is up-to-date. What can be wrong?
False alarm, it worked! I just unticked "soft tabs" in Atom settings and put the tick back. Shall we close this?
Sure :-)
how do we control if it's 2 or 4 spaces?
Most helpful comment
False alarm, it worked! I just unticked "soft tabs" in Atom settings and put the tick back. Shall we close this?