• Welcome to TodayPlus Boards v2.
 

Text editor with syntax highlighting

Started by tree99, February 04, 2005, 03:18:46 PM

Previous topic - Next topic

uk_skinner

tree99:

 Thanks.
 Your contribution just in time to help me learning PHP scripts.

:approve:

tree99

Uk,

You'll love it for PHP.  That language is already defined.  Just click language and select PHP.  You can get other languages which aren't included in the install on the NotePad++ website.  They are all user contributed.  There are great communities all over the web. :D  I couldn't find T+ skin language, had to do that myself.

tree99

Timmy,

Sorry I missed your question about customizing.

QuoteTo change the things to my own wishes, can you teach me for example one thing: changing 'else' into green (but not the bold from 'if' and 'endif'). I think I have to use the useDefineLang.xml? But I also saw the word 'else' was in TodayPlus.api?

I have posted this I don't know if you saw it:
Quote
The file userDefineLang.xml is changed by the program itself. You don't need to do it with a text editor. Just click the menu: View\User Define Dialog. A window with tabs and buttons will pop up for you to adjust the keywords, folder words. etc., and the colors of such.
I forgot to add that you should choose the language you are modifying in the box at the top of this window.

You have the ability to create 4 groups of keywords.  Each group can be formatted in it's own unique way.  I have most of the codes in group 1, they are light blue.  If you have a code in two keyword groups the formatting will be taken from the lowest number group.  e.g. When else is in group 1 and group 3, the formatting for else will look like  the formatting for group 1.   This also affects folder codes ( code matching).  In order for code matching the code names can not be in a keyword group.  e.g. I have removed if and endif from all keyword groups.  The codes you put in the .api file do not affect the formatting, the .api file is for autofill and words can and should be duplicated here.

The best way to have approached this would have been to make a complete text file of all T+ skin codes.  Each code on its' own line and in alphabetical order.  Save this list as C:\Program Files\Notepad++\plugins\APIs\todayplus.api.  Copy the list to keyword group 1.  Remove all codes from keyword group one that you wish to use for code matching.  Move keywords from group 1 to the other groups as you choose for different formatting.  I don't have a complete codes list yet, I just wanted to get you started.  I was also learning the program on the fly.  Hindsight is always perfect.  When I feel it is complete I will post it.

Timmy

Tree99,

You've declared the things very clear to me!!! Thanks for your time! Now I think I'm able to change some things to my own wishes.

Indeed, as you said before: it's a nice program, that makes it easier to handle a skin.txt file or other kind of files.

Thanks again!
Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

Timmy

Tree99,

After working and playing for several hours with Note++ I say it again: it's a nice program to work with. In the meantime I've changed all the things to my own wishes.

There's only one thing I couldn't manage. As you said, there should be am autofill feature, using the TodayPlus.api. But that feature don't do it's work. And I couldn't find a key or button in Note++ to fix this. Can you, please, help me another time?

Thanks!
Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

tree99

Timmy,

It doesn't automatically autofill like I expected, but it works.  I wish it would start autofilling as soon as you type anything, that way if it matches you pick it.  Instead you begin typing code and then hit ctrl+space, then you will see the autofill pop up and you just scroll to the correct code, this is why the code list in todayplus.api needs to be in alphabetical order.

Timmy

Tree99,

Thanks for the explanation!

This is also a nice feature, especially for difficult textlines like:
moontime,%var0%,visible,official,3,-2,HH:mm,, %,l

I'm going to make some of these textlines and put them in the TodayPlus.api to prevent mistakes in the text of my skinfile when typing!

Thanks again!
Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

Timmy

Tree99,

Again: thanks for your good tip! I'm still using this program with much pleasere. In the menatime I've found three 'If - Endif' errors in my skinfile...

I've also changed the program to all of my wishes, except one:
I haven't find a way to make the 'Blanks' good visible. Do you know a way to make (only) the 'Blanks' well visible???

'Blanks' at the end of textlines can give strange effects, so I'm seeking for a way to easy find them.

Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

tree99

Timmy,
I'm glad it has worked out well for you.  I like it too.

To answer your question.  Under View chose 'Show all characters'

This will show a dot where the spaces are and an arrow for tabs.

jhollin1138

@tree99:  I can't believe I missed this topic. :oops: I just wanted to thank you for letting use know about one of the best editor I have ever seen for editing scripts.  I think I have a new favorite editor.  :approve:
Jim H

tree99

Timmy,

Now I have a question for you.

 What have you done to track the use of region/endregion codes in the folder setup( like how you track if..endif).  I can't use region because there are places where region is used in an if statent .  I explained this earlier when I first posted

QuoteAs you can see the matching of if to endif worked great, region to endregion did not. The problem was that region is used in some if statements and so this confused the matching. The program is case sensitive so I tried to make region into REGION unless it was an argument in another function. This worked great for matching but made my skin malfunction. I guess T+ is case sensitive for the region code. Funny thing, it was fine to make region all caps for some regions, but not all. To overcome this problem I made sure that all of my REMs were '///' in stead of just '//' and changed the comment setting accordingly. Then I created a match for //region and //endregion in the setup and added them in the skin file near the //region and //endregion codes. That worked for matching and T+ didn't mind the odd coding since //region is just REMmed out.

To look at other peoples skins I have to search for all the region and endregion codes and insert my  //region and  //endregion in the preceeding lines.  I also have to replace '//' with '///'

Have you found a better solution?  I would like to not have to write skins in a special way.  It doesn't test the skins syntax correctly, and essentially I have created new syntax, which is probably bad programming behavior.  I could still have a region defined incorrectly and not have Notepad++ catch it.

tree99

jhollin1138,

Again, your welcome.  It is really a small thing to inform everyone about this editor.  I benefit so much from the skins and forum that sharing this seems so little.  If this helps the great skinners out there, I will benefit from the skins.

I found it after getting frustrated with wordpad.  I feel that a computer should do most of the monotonous stuff so I searched for an editor.  I tried some others, but this one worked the best for me.  I do wish that the search/replace was more capable.  The software is under development so maybe a new version will come out that does more.

Timmy

Quote from: "tree99"Timmy,
I'm glad it has worked out well for you.  I like it too.

To answer your question.  Under View chose 'Show all characters'

This will show a dot where the spaces are and an arrow for tabs.
Tree99,

Thanks for you answer!

First I'll answer to your question. No. I didn't find a better way to show the beginning and the end of a region. I only made changes in the colours to make it easier to see. I attached the TodayPlus.api to show you.

Second I have a question for you. I still have problems with the 'Blanks'. The dot for spaces is too small to be easy to view. If you have a better idea: please let me know!

Timmy
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

tree99

Timmy,

? to trailing spaces...that is all I know of.  I don't think you can customize the symbols that NotePad++ uses.  I see that you can customize the button icons, but that doesn't help.
When I choose 'Show all characters'  I see a CR and LF that are black-boxed .  these are the end line carriage return marks.  When there are trailing spaces (line 6) you see the dots and then the CR and LF far from the end of your code.  When there are no trailing spaces (line 7) the CR and LF are butted up right next to the end of your code.   So you can look for the space from the end of you line to the black-boxed code

I don't think it allows you to search for end of line so you can't do a search replace for 'spaces followed by end of line' to just an 'end of line'  That can be done with another text editor though.  I have looked at my other text editors but can't find one that does, I know I have done it before, maybe I have done it with MS Word.

Another thought is your zoom level.  You might be zoomed out too far to see the dots well enough.  Under View chose 'Zoom in' or 'Zoom out'  or CTRL+MouseWheel-up/down

tree99

Yeah!!

I am no longer a 'newbie', my status in the forum has changed to 'user'
I must be moving up in the world.  Hey, I've got to be excited about whatever I can get.  LOL