Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-10 07:12:04

carlos123
New Member
Registered: 2009-04-10
Posts: 7

The 8 space tabs in the editor are driving me nuts!

Whenever I view a style sheet or form html or otherwise the tab spacing in the source code is set to 8 spaces. I can’t read source code with 8 spaces! At least not very easily.

Is there any way possible to get rid of the annoying 8 spaces per tab and have it come down to 2 or 4 spaces??

This is enough of an irratation to me to go to another software other than TextPattern though it seems to be an excellent product.

Thanks.

Carlos

Offline

#2 2009-04-10 07:17:58

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: The 8 space tabs in the editor are driving me nuts!

Use spaces. Tab characters are meant to be 8 characters wide. Some Firefox extensions that’ll help out: It’s All Text (edit text in your preferred editor) and Tabinta (insert hard or soft tabs in textareas).

Offline

#3 2009-04-10 07:22:41

carlos123
New Member
Registered: 2009-04-10
Posts: 7

Re: The 8 space tabs in the editor are driving me nuts!

jm wrote:

Use spaces. Tab characters are meant to be 8 characters wide. Some Firefox extensions that’ll help out: It’s All Text (edit text in your preferred editor) and Tabinta (insert hard or soft tabs in textareas).

Thanks jm but I am aware that I can use spaces and all that. It’s that the default spacing in the files which I can edit through TextPattern is 8 spaces. I’ve Googled and searched and searched to find a way around this nonsense of 8 spaces and just can’t find anything.

Most editors worth their salt have an option to set the tab spacing to whatever one wants. Am I stuck having to accept TextPatterns 8 spaces? Is my only option to copy the code into my own editor?

Any further input would be appreciated.

Carlos

Last edited by carlos123 (2009-04-10 07:23:15)

Offline

#4 2009-04-10 07:27:01

carlos123
New Member
Registered: 2009-04-10
Posts: 7

Re: The 8 space tabs in the editor are driving me nuts!

I can copy the text from inside the editor box that appears in TextPattern, paste it into my favorite text editor, and voila..the 8 spaces before each line of code is reduced down to two, just like I like it. But…I am trying to avoid all this copying and pasting and instead just stick to using the built-in editor in TextPattern. And trying to figure out how to set the spacing that appears before each code line which is set by TextPattern to 8 spaces.

Carlos

Offline

#5 2009-04-10 07:32:40

carlos123
New Member
Registered: 2009-04-10
Posts: 7

Re: The 8 space tabs in the editor are driving me nuts!

There are definitly tab characters inside the underlying code that shows up within TextPattern (I mean the underlying CSS, HTML edited through TextPattern).

If I go to the beginning of a line of code and press Del, the tab is deleted and the line jumps to the left hand margin. Is there NO way to set the tab spacing to something other than a default 8 spaces??????

Carlos

Offline

#6 2009-04-10 07:53:53

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: The 8 space tabs in the editor are driving me nuts!

carlos123 wrote:

If I go to the beginning of a line of code and press Del, the tab is deleted and the line jumps to the left hand margin.

That’s because it is a tab character. A hard tab (\t) displays as 8 characters, but it is only one character.

Is there NO way to set the tab spacing to something other than a default 8 spaces??????

Install the Tabinta extension, go to about:config and set tabinta.hard to false and tabinta.tab_width to 2,4, etc.

Offline

#7 2009-04-10 08:04:21

carlos123
New Member
Registered: 2009-04-10
Posts: 7

Re: The 8 space tabs in the editor are driving me nuts!

Thanks jm but that extension did not do anything. The 8 space tabs remain. When I copy and paste into my favorite editor the tabs are still there but they are just spaced at 2 spaces. I am going to try and mass replace the crazy tabs with spaces inside my editor and putting the code back into TextPattern and see if I can get rid of the crazy spacing that way.

Thanks for all your input. Much appreciated.

Carlos

Offline

#8 2009-04-10 08:09:48

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: The 8 space tabs in the editor are driving me nuts!

Sorry, I didn’t mean to imply Tabinta would change the display of existing tabs. It only affects the tabs you insert in a textarea.

Offline

#9 2009-04-10 08:18:29

carlos123
New Member
Registered: 2009-04-10
Posts: 7

Re: The 8 space tabs in the editor are driving me nuts!

Yeah…I think I finally got around this problem for good. I just zapped those crazy tabs away in my editor, replaced them with proper spacing :), and overwrote the existing code in the TextPattern edit boxes. No more 8 spaces. How people can look at 8 spaced tab CSS and HTML code is beyond me.

Thanks again jm. Your help was invaluable in helping me figure this out. I helped a great deal to know that someone else in internet la la land knew what I was talking about!

Carlos

Offline

#10 2009-04-10 08:40:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: The 8 space tabs in the editor are driving me nuts!

carlos123

fwiw, it annoys the crap outta me too. An “8 space” tab stop just means more lines that wrap in the fairly narrow Textareas on the Stylesheet, Page and Form tabs and makes stuff way harder to read / debug for quick edits to page layout.

You’d think in Firefox’s myriad options under about:config there’d be something as simple as “Textarea tab stop: n spaces” but if it’s there, I can’t find it. Perhaps rendering tabs in a browser is more complicated than I can grasp?

Like you, I have resorted to copying out the contents of each page / form to a text editor, globally replacing tabs with 3 spaces and pasting it back into TXP’s Textarea. Of course, my “wastage” alarm goes off in my head that it will bloat each page request by 2 or three times the number of tabs, and that soon adds up on a hosting package with limited bandwidth.

Also, sort of related, it kinda irks me that every single TXP tag renders a single newline in the HTML source whether it outputs anything or not. So things like conditional tags and <txp:variable /> output one blank line per command. I have some TXP forms that are simply reams of <txp:variable /> commands to set up a data store for later retrieval. I load this after my </head> tag has finished, and one such form has about 40 variable definitions in it. If I View Source of the rendered web page, I see 40 blank lines between the </head> and the <body>. Again, it’s a waste of bandwidth and looks u-g-l-y imho. Not sure if anything can be done about it because it seems that, while the output of the tag renders nothing, the newline added at the end of the tag in the Textarea remains and is passed to the output page.

It’s probably just my mild OCD kicking in, as it doesn’t seem to bother anybody else how many bytes a page eats up when it renders. Perhaps it’s my 8-bit Z-80 background where every byte had to count! I just find it odd that such a lightweight CMS can make big-ass pages full of whitespace without me being able to do anything about it — save for writing my entire site on one line ;-)

Last edited by Bloke (2009-04-10 08:42:30)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#11 2009-04-10 08:47:21

carlos123
New Member
Registered: 2009-04-10
Posts: 7

Re: The 8 space tabs in the editor are driving me nuts!

Thanks bloke. Your post made a fitting end to the several hours I spent trying to get rid of them nasty, useless, frustrating, extra spacing! In the sense that I am now comforted that another soul somewhere on this Earth feels frustrated by some of this too!

Fortunately I have a lot less frustrating days usually. I guess my frustration level is much higher when I first start in on a new program like TextPattern. You should have seen me when I started in on Linux from Windows. I could have thrown the computer or pulled my hair out back then LOL. Until I figured out Linux and now I love it. Maybe the same thing will happen with TextPattern. I“ve heard great things about it.

Thanks again for sharing.

Carlos

Offline

#12 2009-04-10 09:05:17

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: The 8 space tabs in the editor are driving me nuts!

Bloke wrote:

I just find it odd that such a lightweight CMS can make big-ass pages full of whitespace without me being able to do anything about it — save for writing my entire site on one line ;-)

This is what Textpattern is all about: Make no assumptions about the author’s desired markup. If she introduces line-feeds, these are output. Textpattern adds dynamic content by parsing tags, not by interpreting the fluffiness between tags. Period.

OTOH, a mildly daring plugin author might take the endeavour to produce a HTMLTidy plugin of sorts to cater for the demand of aesthetically ambitious users.

Offline

Board footer

Powered by FluxBB