tab to spaces #106

Closed
opened 2011-05-29 06:19:31 +02:00 by marijnh · 7 comments
marijnh commented 2011-05-29 06:19:31 +02:00 (Migrated from gitlab.com)

Here's a feature request for translating tab to spaces. (like one tab -> two or four spaces )

Code mirror use pre to emulate tabs , but the default tab width in browser is too big ,
A suggestion is to create a option to use spaces with a xml-tab wrapper to instead of tab.

That will make it more useful , although I think it also will gain some performance cost.

Here's a feature request for translating tab to spaces. (like one tab -> two or four spaces ) Code mirror use pre to emulate tabs , but the default tab width in browser is too big , A suggestion is to create a option to use spaces with a xml-tab wrapper to instead of tab. That will make it more useful , although I think it also will gain some performance cost.
marijnh commented 2011-05-29 14:54:06 +02:00 (Migrated from gitlab.com)

This won't happen. Tabs are tabs, and if you want to convert them to spaces it is trivial to use some external code to do that.

This won't happen. Tabs are tabs, and if you want to convert them to spaces it is trivial to use some external code to do that.
marijnh (Migrated from gitlab.com) closed this issue 2011-05-29 14:54:06 +02:00
marijnh commented 2011-05-29 17:18:31 +02:00 (Migrated from gitlab.com)

I mean it's still a tab in "value", but use spaces in "view".

What actually I want is a "tab size" feature
That make sense for almost all modern editor ,
like in Notepad++ it has a "tab size" to adjust the tab view.

http://screencast.com/t/3xKezQxpzlBB

It's just a feature request , i could handle it well by myself,
I am fine if you think that's still a trivial one. ;)

But I think it's still a common usage for editors and worth to post a feature request for me.

I mean it's still a tab in "value", but use spaces in "view". What actually I want is a "tab size" feature That make sense for almost all modern editor , like in Notepad++ it has a "tab size" to adjust the tab view. http://screencast.com/t/3xKezQxpzlBB It's just a feature request , i could handle it well by myself, I am fine if you think that's still a trivial one. ;) But I think it's still a common usage for editors and worth to post a feature request for me.
marijnh commented 2011-05-29 17:24:21 +02:00 (Migrated from gitlab.com)

Ah, I see what you mean now. This is not practical, unfortunately, until browsers allow reliable control over tab-size through CSS styling. To make cursor movement consistent, the tab size in the display has to match the tab size in the hidden textarea.

Ah, I see what you mean now. This is not practical, unfortunately, until browsers allow reliable control over tab-size through CSS styling. To make cursor movement consistent, the tab size in the display has to match the tab size in the hidden textarea.
marijnh commented 2011-05-29 17:26:42 +02:00 (Migrated from gitlab.com)

ok ,got it. Thanks anyway. ;)

ok ,got it. Thanks anyway. ;)
marijnh commented 2011-10-05 01:52:29 +02:00 (Migrated from gitlab.com)

Why is this impractical? Can't the tab be marked up with a span in which we can change the letter spacing?

Or, better yet, why not auto-convert tabs to a set number of spaces, and just treat them differently when navigating, deleting, etc?

This is a must-have for any text editor, for sure.

Why is this impractical? Can't the tab be marked up with a span in which we can change the letter spacing? Or, better yet, why not auto-convert tabs to a set number of spaces, and just treat them differently when navigating, deleting, etc? This is a must-have for any text editor, for sure.
marijnh commented 2020-09-26 22:01:51 +02:00 (Migrated from gitlab.com)

Ah, I see what you mean now. This is not practical, unfortunately, until browsers allow reliable control over tab-size through CSS styling. To make cursor movement consistent, the tab size in the display has to match the tab size in the hidden textarea.

Just want to give an update that it's possible now with the ch unit. So .cm-tab { width: 8ch } will make the tab has the width of 8 characters

> Ah, I see what you mean now. This is not practical, unfortunately, until browsers allow reliable control over tab-size through CSS styling. To make cursor movement consistent, the tab size in the display has to match the tab size in the hidden textarea. Just want to give an update that it's possible now with the `ch` unit. So `.cm-tab { width: 8ch }` will make the tab has the width of 8 characters
marijnh commented 2020-09-26 23:18:18 +02:00 (Migrated from gitlab.com)

mentioned in issue #19

mentioned in issue #19
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#106
No description provided.