Page 1 of 1

python syntax - get it now! ...and a question

Posted: 16 Aug 2011 01:37
by yniq
I've created a python syntax file by converting an ultraedit one and some additional modifications.
It is probably not complete and can be improved a lot.

There is however a problem with wither RJ TextEd or with my syntax file. When I use the following python file:

Code: Select all

def 0:
    pass

def 1:
    pass

    def 1.1:
        pass

def 2:
    pass
- and then use Alt+up/down to move to previous/next nodes, the caret stops on def 0, def 1.1 and def 2 when going down, and def 2, def 1.1, <the line before def 1> and def 0 when going up.
- there is no [+] sign on the fold bar next to the def 1 line
- when I use Alt+down to get to def 2, the last two lines are highlighted ('def 2' and 'pass') instead of just the def 2 line
- all 4 functions appear in the code explorer tab on the left
- I'm using RJ TextEd portable ver 7.60 on windows XP

Another issue - the highlighters preview doesn't work for me - just for the python syntax. I see the text but it is all black on white. The editor window however is fine.

The syntax file is attached in the next message

Re: python syntax - get it now! ...and a question

Posted: 16 Aug 2011 06:42
by yniq
Attached python syntax file

Re: python syntax - get it now! ...and a question

Posted: 18 Aug 2011 15:56
by Rickard Johansson
Try this, it should solve your problems.

Re: python syntax - get it now! ...and a question

Posted: 19 Aug 2011 06:13
by yniq
Thanks! It does solve all the problems except for
"- when I use Alt+down to get to def 2, the last two lines are highlighted ('def 2' and 'pass') instead of just the def 2 line"
which is very minor anyway.

Maybe you can include the python syntax file with your releases? (probably needs some more work anyway...)

Re: python syntax - get it now! ...and a question

Posted: 19 Aug 2011 14:06
by Rickard Johansson
Actually, the highlighting is correct since pass is on the last line and both the start and end portion of the fold is highlighted.

I need a color file "python.ssx". You can create one by setting all colors in options (Highlighters) and click on the export button to save the color file. I think it's better you do it since I don't program in Python.

Re: python syntax - get it now! ...and a question

Posted: 23 Aug 2011 00:54
by yniq
Hey,

I've modified the syntax file a bit, and exported the ssx file. I've also attached the [Python] section in my TextEd.ini file in case you need it.