viewing files with tabs

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
rbro
Posts: 4
Joined: Mon Nov 23, 2009 5:35 pm

viewing files with tabs

Post by rbro »

I am running into a small issue with TextPad where a line containing tabs isn't displayed properly when syntax highlighting is enabled. As an example, place the following line into a file test.js:

var test = ' abc';

The characters between the single quotes are: [tab]abc

When I open up that file in TextPad, it displays as:

var test = 'abc' ;

I can definitely see where the tab is as I move around the line with the arrow keys, but the display is not correct.

Does anyone have any ideas on how to get around it? The problem only appears when syntax highlighting is enabled. When syntax highlighting is disabled, the file displays correctly.

Thanks for your help.

Ryan
User avatar
bbadmin
Site Admin
Posts: 878
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post by bbadmin »

Ryan, it turns out that this problem has existed in TextPad for years, but has not been noticed before because the convention in most programming languages is to represent a tab in a string with '\t'. Hence, a workaround is to type:

var test = '\tabc';

See the section headed "Special Characters" at w3schools.com for more information.

We'll look into the cause, but I'm not convinced that it makes sense to expect layout characters to work in strings.

Keith MacDonald
Helios Software Solutions
Post Reply