typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

Tabs & Spaces Options #579

Open danshao opened 7 years ago

danshao commented 7 years ago

Tabs should be rendered as spaces.


abnerlee commented 6 years ago

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

gandalfsaxe commented 6 years ago

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?

chrispat commented 5 years ago

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.

vassudanagunta commented 5 years ago

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?

justnealpatel commented 5 years ago

Is this still going to be added? @abnerlee

MarkWithall commented 4 years ago

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.

zhujingzhi commented 4 years ago

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.

gilbertohasnofb commented 3 years ago

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.

flamewave000 commented 3 years ago

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.

jekyllgrim commented 3 years ago

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.

strblr commented 3 years ago

Any update ?

jekyllgrim commented 2 years ago

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.

StrangeRanger commented 2 years ago

Any idea when this might be implemented?

KrGil commented 2 years ago

Is there any solutions? or just same as is?

jekyllgrim commented 2 years ago

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.

StrangeRanger commented 2 years ago

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

jiongjiongli commented 1 year ago

Any updates on this?

DemianLi96 commented 8 months ago

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
MoeLeaf commented 2 months ago

To address this issue, you could use AutoHotkey to convert tab to 4 spaces when typing tab in typora. Here is the script:为了解决这个问题,您可以在typora中输入tab时使用AutoHotkey将tab转换为4个空格。这是脚本:

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

In the absence of an official option, this is an interesting solution. I tried it out myself and added some improvements. 在官方不提供选项的情况下,这是一个有趣的解决方案,我实际尝试之后为其补充一下

In AutoHotkey V2 the script should be written as: 在 AutoHotkey V2 中脚本应该写作:

#Requires AutoHotkey v2.0

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

Here, if is changed to HotIf so that it only takes effect when the keyboard cursor is in Typora, without affecting other programs. 这里把 if 改成了 HotIf 使得只有键盘光标在 typora 中才生效,不影响其他程序。