Problem with colouring text after a certain column

General questions about using TextPad

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

Post Reply
jameslikestobike
Posts: 4
Joined: Sun Jan 25, 2004 4:47 am
Contact:

Problem with colouring text after a certain column

Post by jameslikestobike »

Hi,

using: TextPad 4.7.2

I'm having trouble colouring text, syntax highlighting, after a certain coloum. Is this even possible?

What I would like is for textpad to designate all text between colum A-B to be given a certain colour.

ie: (NOTE: please pretend that the periods (.) are spaces)

* I am a comment
...BLOCK1...GENERATE...15,10,,,5.....I should be a comment comment too

so everything from...........................^ here should be comment colour

my syntax file looks like:
[Syntax]
Namespace1 = 6
IgnoreCase = No
KeyWordLength =
BracketChars = {[()]}
OperatorChars = -+*/<>!~%^&|=
InitKeyWordChars = A-Xa-x
KeyWordChars = A-Za-z0-9_
SyntaxStart =
SyntaxEnd =
HexPrefix = 0x
CommentStart =
CommentEnd =
CommentStartAlt =
CommentEndAlt =
SingleComment = *
SingleCommentCol =
SingleCommentAlt = A-Za-z0-9_
SingleCommentColAlt = 31
SingleCommentEsc =
<shamelessplug>
My Amature Photography Site
http://photogallery.hopto.org
</shamelessplug>
User avatar
bbadmin
Site Admin
Posts: 820
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post by bbadmin »

TextPad requires a specific character sequence to indicate the start of a comment, even where a start column is given. It does not interpret regular expressions, as that would slow things up too much.

The only workaround I can think of is to insert an asterisk in column 31 of all lines that do not start with an asterisk and are longer than 30 characters. You can do that with the Replace command, as follows, using POSIX style regular expressions:

Code: Select all

Find what: ^([^*].{29})(.+)
Replace with: \1*\2
Keith MacDonald
Helios Software Solutions
jameslikestobike
Posts: 4
Joined: Sun Jan 25, 2004 4:47 am
Contact:

Thanks

Post by jameslikestobike »

Hmm, that's too bad.

Any chance that could be implemented in a future version? :)

Either way, thanks a lot for your help!
<shamelessplug>
My Amature Photography Site
http://photogallery.hopto.org
</shamelessplug>
Post Reply