Page 1 of 1

Problem with colouring text after a certain column

Posted: Sun Jan 25, 2004 4:58 am
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 =

Posted: Sun Jan 25, 2004 12:07 pm
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

Thanks

Posted: Mon Jan 26, 2004 5:53 am
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!