Highlight Object-Methods possible ?
Highlight Object-Methods possible ?
Is it possible, that i can modify the AutoIt-Syntax-Highlighter, so the object-methods are shown in a different color ?
The pattern is: $[object].[method][delimiter like space or '(']
Here is comparison to SciTE4: P.S.: Is it possible, to define more than nine keywords in a theme ?
The pattern is: $[object].[method][delimiter like space or '(']
Here is comparison to SciTE4: P.S.: Is it possible, to define more than nine keywords in a theme ?
- Rickard Johansson
- Site Admin
- Posts: 6653
- Joined: 19 Jul 2006 14:29
Re: Highlight Object-Methods possible ?
I tried this in v8.63,
[Keywords]
#Object method=(?<=\.)[a-zA-Z]+
You can probably create a better regex expression.
You should be able to add more keyword colors manually to the settings file (TextEd.ini)...
[Keywords]
#Object method=(?<=\.)[a-zA-Z]+
You can probably create a better regex expression.
You should be able to add more keyword colors manually to the settings file (TextEd.ini)...
Re: Highlight Object-Methods possible ?
Not in 'Theme.xml' ?Rickard Johansson wrote: You should be able to add more keyword colors manually to the settings file (TextEd.ini)...
- Rickard Johansson
- Site Admin
- Posts: 6653
- Joined: 19 Jul 2006 14:29
Re: Highlight Object-Methods possible ?
That should work as well.
Re: Highlight Object-Methods possible ?
I have used '<Keyword9 color="#00000"....' (keyword 0-8 are exists) in my colortheme.xml-file, but the color doesn't work !?
Color is always blue (default) and styles also doesn't work.
Color is always blue (default) and styles also doesn't work.
- Rickard Johansson
- Site Admin
- Posts: 6653
- Joined: 19 Jul 2006 14:29
Re: Highlight Object-Methods possible ?
Did you remove the theme in the options window first? The editor needs to re-load the .xml file from disk. Once that is done all options are stored in the TextEd.ini file.
Re: Highlight Object-Methods possible ?
No, i didn't. I think restart the editor is enough. I'll test it again tomorrow.
Thanks,
Micha
P.S.: A 'Reload'-function for the colortheme would be nice !
Thanks,
Micha
P.S.: A 'Reload'-function for the colortheme would be nice !
Re: Highlight Object-Methods possible ?
Is there any help about RegEx-character like this:
Code: Select all
(?<=\.)
- Rickard Johansson
- Site Admin
- Posts: 6653
- Joined: 19 Jul 2006 14:29
Re: Highlight Object-Methods possible ?
It's called "positive lookbehind" and you can find some more information at http://www.regular-expressions.info/lookaround.html.
Re: Highlight Object-Methods possible ?
I have tried to improve the recognition of the object-methods.
The 'positive lookbehind'
(?<=\$abc\.)[a-zA-Z]+ --> does work
but
(?<=\$[a-zA-Z0-9]\.)[a-zA-Z]+
or
(?<=\$[a-zA-Z0-9]+\.)[a-zA-Z]+ --> produce an error !
Can someone help ?
Micha
P.S.: Pattern is like '$Abc2.dEf'. It begins with a '$', followed by some letters/numbers and a dot '.'. Then the method begins.
The 'positive lookbehind'
(?<=\$abc\.)[a-zA-Z]+ --> does work
but
(?<=\$[a-zA-Z0-9]\.)[a-zA-Z]+
or
(?<=\$[a-zA-Z0-9]+\.)[a-zA-Z]+ --> produce an error !
Can someone help ?
Micha
P.S.: Pattern is like '$Abc2.dEf'. It begins with a '$', followed by some letters/numbers and a dot '.'. Then the method begins.
Re: Highlight Object-Methods possible ?
Has nobody an idea ?
Waht's wrong at my RegEx ?
Thanks,...
Micha
Waht's wrong at my RegEx ?
Thanks,...
Micha
- Rickard Johansson
- Site Admin
- Posts: 6653
- Joined: 19 Jul 2006 14:29
Re: Highlight Object-Methods possible ?
I don't think you can use regex expressions like \$[a-zA-Z0-9]+\. in a lookbehind or lookaround. It will only work with simple expressions like \. or \$
I'm not sure it works but have you tried (?<=\$\w+\.)[a-zA-Z]+
I'm not sure it works but have you tried (?<=\$\w+\.)[a-zA-Z]+
Re: Highlight Object-Methods possible ?
Yes, if tried it. No error, but no proper function (nothing highlighted).
- Rickard Johansson
- Site Admin
- Posts: 6653
- Joined: 19 Jul 2006 14:29
Re: Highlight Object-Methods possible ?
This works, but it's not an elegant solution:
(?<=\$....\.)([a-zA-Z]+)|(?<=\$.....\.)([a-zA-Z]+)|(?<=\$......\.)([a-zA-Z]+) etc.
(?<=\$....\.) matches a 4 letter name starting with $ e.g. $Name
(?<=\$.....\.) matches a 5 letter name ...
You can add as many expressions you want separated by |
(?<=\$....\.)([a-zA-Z]+)|(?<=\$.....\.)([a-zA-Z]+)|(?<=\$......\.)([a-zA-Z]+) etc.
(?<=\$....\.) matches a 4 letter name starting with $ e.g. $Name
(?<=\$.....\.) matches a 5 letter name ...
You can add as many expressions you want separated by |