typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

Tabs & Spaces Options

Open danshao opened this issue 7 years ago • 18 comments

Tabs should be rendered as spaces.


  • Use tab / use space
  • Tab size
  • Tab for alignment

danshao avatar Mar 08 '17 08:03 danshao

relates https://github.com/typora/typora-issues/issues/498

abnerlee avatar Jan 25 '18 03:01 abnerlee

Is this a request for inserting spaces instead of tabs when pressing tab to lign up elements? Because that's what I want.

Note, #498 is something entirely different; it's about customizing the number of spaces that a tab character visually looks like. What I want is to actually insert space characters when pressing tab. Is this the right issue for that?

gandalfsaxe avatar Jul 18 '18 20:07 gandalfsaxe

Inserting tabs instead of spaces when I press tab causes problems in a number of other editors and markdown rendering. Specifically, I see this in GitHub and VSCode.

chrispat avatar Apr 18 '19 17:04 chrispat

CommonMark spec on tabs:

Tabs in lines are not expanded to spaces. However, in contexts where whitespace helps to define block structure, tabs behave as if they were replaced by spaces with a tab stop of 4 characters.

GFM is CommonMark compliant, and I believe VSCode is as well. If Typora's WYSIWYG rendering is consistent with this, then there shouldn't be any problem between Typora, GitHub and VSCode.

@chrisrpatterson Can you describe the problems? Can you confirm that Typora isn't following CommonMark spec?

vassudanagunta avatar Apr 18 '19 19:04 vassudanagunta

Is this still going to be added? @abnerlee

justnealpatel avatar Sep 05 '19 21:09 justnealpatel

Possibly related. If I indent an unordered list item from 'Source Code Mode' it is indented with a tab character but if I indent it from normal mode, it is indented with two spaces. I'm not sure if this is the intended behaviour.

MarkWithall avatar Apr 02 '20 11:04 MarkWithall

Inserting tabs instead of spaces when I press tab causes problems in a number of other editors and markdown rendering. Specifically, I see this in GitHub and VSCode.

Did you solve this problem? If it is solved, how to solve it? I also encountered the same problem. Hope to get an answer. Thank you.

zhujingzhi avatar May 13 '20 10:05 zhujingzhi

Many projects I participate have automated checks for code style, which enforce the preference for spaces or tabs among other things. Most text editors I know of have a checkbox for this in their Settings menu, and it would be really great if Typora did the same.

gilbertohasnofb avatar Nov 02 '20 16:11 gilbertohasnofb

I'm currently annoyed with having no option of using the proper tab character for tabbing in code blocks instead of the pita "N space" tab. This makes writing well formatted code difficult in the code blocks. I can see in Typora 0.9.98 (beta) you can set the number of space characters to use for code tabs, but no option to use the actual tab character that is made for that function. I know there is a lot of silly debate over which is better (tabs vs spaces, IMO tabs are objectively better), but I'm currently having to search and replace the spaces on my MD files after writing code blocks.

flamewave000 avatar Jan 27 '21 22:01 flamewave000

Why exactly is this issue closed? Do we finally have an option to render tabs as spaces? Because that's the only solution that would warrant closing it. I can see multiple other closed issues to be linked to this one as if it contains a solution, but it doesn't seem like it.

jekyllgrim avatar Jul 07 '21 15:07 jekyllgrim

Any update ?

strblr avatar Aug 16 '21 22:08 strblr

Any updates on this? Typora just updated to a paid verison, and yet writing well-formatted code in Allman style still doesn't seem possible. Every time I hit Enter the new line gets auto-indented with spaces, yet tabs are still tabs.

jekyllgrim avatar Jan 05 '22 10:01 jekyllgrim

Any idea when this might be implemented?

StrangeRanger avatar Jun 16 '22 23:06 StrangeRanger

Is there any solutions? or just same as is?

KrGil avatar Aug 04 '22 04:08 KrGil

I got tired of waiting and moved to Mark Text. I don't know why I'm supposed to pay for a product that still hasn't solved basic issues.

jekyllgrim avatar Aug 04 '22 06:08 jekyllgrim

@abnerlee Are we ever gonna get a response to our questions regarding this issue? I'm just about to Join Jekyllgrim in using a different tool, as this is ridiculous that it's been 5 years later and nothing has changed or been done.

StrangeRanger avatar Aug 12 '22 23:08 StrangeRanger

Any updates on this?

jiongjiongli avatar Jul 28 '23 03:07 jiongjiongli

To address this issue, you could use AutoHotkey to convert tab to 4 spaces when typing tab in typora. Here is the script:

#if WinActive("ahk_exe typora.exe")
    Tab::Send {Space 4}
#if

DemianLi96 avatar Jan 18 '24 00:01 DemianLi96