Jump to content


Photo

New syntax editor


  • Please log in to reply
11 replies to this topic

#1 Miloch

Miloch

    Barbarian

  • Modders
  • 4749 posts
  • Gender:Male
  • Location:At Large

Posted 28 November 2006 - 02:54 PM

I got a bit fed up with ConText and Crimson Editor. Nothing personal - they're both good tools but lack features I want. In particular, they don't seem to work well with certain international character sets - at least not on my computer.

So I found a free text editor I'm finally happy with - PSPad. I've even converted the ConText/Crimson TP2/BAF/TRA/D syntax highlighters on the G3 wiki to work with this tool. Just stick these files in your \PSPad\Syntax folder and (re)start the tool. It should automatically recognise and highlight the relevant files.
> WeiDU_BAF.INI
> WeiDU_DTRA.INI
> WeiDU_TP2.INI

In addition to what you'd expect, it has the following features:
> External compiler support
> Text difference comparison
> Hex editing
> Foreign language/unicode character support
> Text/HTML/CSS converters (quick and clean)
> Web browser/previewer
> Automatic formatting
> Automatic window arranging
> Spell checking in multiple languages
> Macro recorder
> Shell integration

Example: PSPad syntax highlighting
Posted Image

Edited by Miloch, 27 January 2007 - 12:12 PM.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett

#2 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 6913 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 28 November 2006 - 04:01 PM

Cool! Add them to the Wikki?

Edited by cmorgan, 28 November 2006 - 04:01 PM.

I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams

#3 Miloch

Miloch

    Barbarian

  • Modders
  • 4749 posts
  • Gender:Male
  • Location:At Large

Posted 28 November 2006 - 04:35 PM

Sure, go ahead (I don't have write access). ;)
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett

#4 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 6913 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 28 November 2006 - 06:26 PM

hmmm... did you set up a password? I had some trouble with it at first, but got it all set. PM me if you don't get it resolved, and I will go\ive it a shot!
I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams

#5 Rigel

Rigel
  • Members
  • 6 posts

Posted 27 May 2009 - 04:40 AM

Hello i've just donwload PS pad who is really more "user friendly" and have many usefull options, he is better than ConTEXT.
My question is about the Highlighters : the ones for PS pad are not exactly the same as the Highlighters for Context. I tried copy the .chl categories Highlighters in the .ini but it wasn't detected... I'm used to the ConTEXT higlithers and i would like have exactly the same ones !!! If someone can help me resolve that little technical problem it would be great !

Here are the Context Highlighters categories
Posted Image

Here are the PSPad Highlighters categories
Posted Image

You can see that categories are not the same !

Edited by Rigel, 02 June 2009 - 02:35 PM.


#6 Miloch

Miloch

    Barbarian

  • Modders
  • 4749 posts
  • Gender:Male
  • Location:At Large

Posted 27 May 2009 - 07:40 AM

My question is about the Highlighters : the ones for PS pad are not exactly the same as the Highlighters for Context.

Well, I haven't updated these for over 2 years, and cmorgan has made changes to the ConTEXT filters. So someone would probably have to grab his most recent highlighters (probably more recent than his last update here a year and a half ago) and try to replicate them in PSPad.

This is pretty easy if you want to try it. Just go to Settings > User Highlighter and open the relevant INI file (such as WeiDU_TP2.INI). PSPad gives you 4 highlighting categories you can customise (these show up in the .ini as KeyWords, ReservedWords, KeyWords2 and KeyWords3). I think ConTEXT gives you 5 categories - that is the only difference that I can tell. PSPad highlights the current line, matched braces, right edge and selection automatically, though you can turn these off too (such as View > Active Line). You can also change the colours and fonts under Settings > Highlighters Settings (as in your screen shot).

So basically, this would just be a matter of matching the PSPad keywords to the ConTEXT/Crimson ones as closely as possible. Cmorgan gave more information on working with those filters here.

To be honest, I don't use these much anymore, since I've gotten somewhat used to reading WeiDU code. But I will say PSPad is still absolutely stellar for many things, like seeing text differences in two files. If you have two different versions of code, you can select both files, right-click > PSPad > PSPad TextDiff to see the differences quite easily. It is also a good with hex (binary code) and can structure and compress HTML and CSS, making it a great web page editor.
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett

#7 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 6913 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 27 May 2009 - 11:04 AM

Hey, Miloch, does it allow for quicktext or autocompletion of code snippets?

Mike1072 had built a cool quicktext function set for NotePad++ that alowed you to type (for example

sgd

and hit a key turning it into

IF ~Global("TEXT","GLOBAL",#)~ THEN BEGIN statename
SAY ~TEXT~
IF ~~ THEN EXIT
END

and I have been puttering with the equivalent on Crimson and TextPad... does PSP do this? Because if it does I might want to make the switch, too.
I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams

#8 Miloch

Miloch

    Barbarian

  • Modders
  • 4749 posts
  • Gender:Male
  • Location:At Large

Posted 27 May 2009 - 11:15 AM

Hey, Miloch, does it allow for quicktext or autocompletion of code snippets?

Apparently, it does as of 4.5.3. And scripting and a bunch of other stuff. I'm still using 4.5.2, but I downloaded the new version.

Have you made updates to your highlighters or is the version on the Tools page the latest?
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett

#9 Rigel

Rigel
  • Members
  • 6 posts

Posted 01 June 2009 - 02:17 AM

OK thanks a lot for your answer Miloch, i'll try make some new .ini file with your new advices: it's exactly what you say :

PSPad gives you 4 highlighting categories you can customise (these show up in the .ini as KeyWords, ReservedWords, KeyWords2 and KeyWords3). I think ConTEXT gives you 5 categories

There is just one more categorie with most recent Highlighters for ConTEXT (as you can see in my screenshot too), but if PSPad allow only 4 categories... How about making 5 ? Can we ADD one more categorie in PSPad?

Edited by Rigel, 01 June 2009 - 02:29 AM.


#10 Miloch

Miloch

    Barbarian

  • Modders
  • 4749 posts
  • Gender:Male
  • Location:At Large

Posted 01 June 2009 - 12:39 PM

How about making 5 ? Can we ADD one more categorie in PSPad?

Not that I could see in 4.5.2 but there might be a way in the newer version. But do we really need 5 categories? I think we should just group them all into 4 categories with clearly defined labels. My eyes go funny with too many colours on the screen anyway :crazyeyes:. In these highlighters, I just kind of threw the commands into different categories arbitrarily without thinking about it too much. But maybe cmorgan has arranged them more intelligently in his newer highlighters.
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett

#11 Mike1072

Mike1072
  • Gibberlings
  • 1766 posts
  • Gender:Male
  • Location:Canada

Posted 01 June 2009 - 07:39 PM

How about making 5 ? Can we ADD one more categorie in PSPad?

Not that I could see in 4.5.2 but there might be a way in the newer version. But do we really need 5 categories? I think we should just group them all into 4 categories with clearly defined labels. My eyes go funny with too many colours on the screen anyway :crazyeyes:. In these highlighters, I just kind of threw the commands into different categories arbitrarily without thinking about it too much. But maybe cmorgan has arranged them more intelligently in his newer highlighters.

In the Notepad++ ones I'm currently using (and have sent to cmorgan), I tried to group things by their role in WeiDU (all patches in one category, actions in another, with modifiers to these commands [ie. GLOB, EQUIP] noticeably different) and the flow control commands (IF, FOR) being highlighted. I used all 4 of the groups in N++, but I didn't really need the last (just used it for fancy array highlighting). It has extra spots where you can specify comments, strings, brackets, and numbers though. I've been trying them out for a while and they're working well for my purposes.

Here's a comparison of old and new.

Notepad++ does have a few nice features that make it good for editing (the aforementioned code insertion is handy, and code folding is okay) but it has drawbacks as well. The regular expression search/replace unfortunately doesn't work on multiple lines unlike Textpad (non-regexp search/replace works fine), and while I was successful in setting up code completion (start typing and it'll start guessing), it seemed to cause random crashing, so I won't be using that feature until they fix it. Also, you often have to have whitespace between codewords for them to be recognised by N++ even when WeiDU doesn't require it (this is especially problematic in some block comments that appear to span lines that they don't), and code folding requires an additional marker be inserted at the end of each component, but both of these are only issues when viewing code written by others, they aren't a problem when writing your own.

I used to use Textpad, but now I use N++ for all my editing except mass regexp text manipulation and cutting/pasting things column-wise.

#12 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 6913 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 02 June 2009 - 03:37 AM

Mike1072's categories make sense - the raw data to recreate them is in the general workroom, but one summer project is to get them out. Unfortunately, NotePad++ versioned up just as we were playing with it, and I can confirm the random crashing with QuickText and autocompletion - the QuickText one I may have solved by a reinstall of he latest version.

I like lots of colors, so my favorite is still the Crimson Editor 7 category spread - but remember, that is because I work with dialog a good bit.

Currently, I switch to Crimson for dialog and column editing, TextPad for regexp search and multiple file/directory searches, use both ConTEXT and Crimson code snippets, and use NotePad++ with Mike1072's edits for .tp2/.tpa work. Then go to work and have to use a Mac, so I use a simplified bbcode highlighter with TextWrangler.

Heh. To create simple documents.
I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users