BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

OpenBVE Syntax highlighter for Notepad++

2 posters

Go down

OpenBVE Syntax highlighter for Notepad++ Empty OpenBVE Syntax highlighter for Notepad++

Post by leezer3 Fri Sep 23, 2011 1:17 am

Something OpenBVE developers currently lack is a decent syntax highlighter Smile
There was one for ConTEXT a while back (I had it, but I've lost it!), and last night I was bored & decided to cook something up to fill this gap, and this is what came out of it:
OpenBVE Routefile Syntax Highlighter Plugin for Notepad++
---------------------------------------------------------

V1.1
----
* Properly compiled aginst Notepad++ v1.8 as a 'Unicode Release'.
* Now fixed to no longer be case sensitive.

General
-------
This was created by Christopher Lees (leezer3@bvecornwall.co.uk) &
based upon the GPL Gmod Lua Highlighter created by Kyle Fleming (aka Garthex)

This plugin will highlight most standard OpenBVE routefile syntax by default.
There are 6 keyword parser groups, which is the most this plugin will support properly. I've divided these into these categories:
* Primary Paramaters:
curve adhesion turn pitch fog brightness limit ground height
* Rails & Types:
rail railstart railend railtype
* Walls & Dikes:
wall wallend dike dikeend pole poleend crack
* Freeobjects & Sounds:
freeobj announce Announce
* Signalling & Markers:
sigf SigF section Section beacon marker Marker
* Stations & Platforms:
sta stop form forml formr

The default highlighter colors are stored in hex format in the second section of the OpenBVE.xml file.
You can easily add more commands & variations by editing the OpenBVE.xml file, or alternatively mail me and I'll
see what I can do Smile

Keywords & colors can also be added/ edited by using the 'Settings\Style Configuratior' dialog.

Installation
------------
Open your 'Notepad++\Plugins' folder.
Before proceeding, please ensure that Gmod Lua is not currently installed (Delete GmodLua.dll & config\GmodLua.xml)
Place OpenBVE.dll & the Config folder inside your "Notepad++/plugins" folder.
Open Notepad++ & OpenBVE should now show up in your 'Language' menu.

Further Points
--------------

For more information on the Gmod Lua plugin, please visit:

Official SVN/Wiki hosting-
http://code.google.com/p/npp-gmod-lua/


Facepunch forum release thread-
http://forums.facepunchstudios.com/showthread.php?p=8625735

SourceForge.net download page-
https://sourceforge.net/project/showfiles.php?group_id=189927&package_id=265782

Special Thanks for borrowed code:

Thell Fowler
Robert Roessler
Paul Winwood
Alexey Yutkin
Marcos E. Wurzius
Philippe Lhoste

The initial source is at the Google code link, I've only made some very small changes. Will post my source as soon as the code stabilises a bit Smile
Will also add this to my site once it's stable.

Cheers

Chris Lees

http://www.bvecornwall.co.uk
Attachments
OpenBVE Syntax highlighter for Notepad++ Attachment
OpenBVE-Notepad++ v1.1.zip You don't have permission to download attachments.(66 Kb) Downloaded 51 times

leezer3

Posts : 1955
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

OpenBVE Syntax highlighter for Notepad++ Empty Re: OpenBVE Syntax highlighter for Notepad++

Post by mrknowitall Fri Sep 23, 2011 8:36 am

am i right in saying this only works with a certain type of code? im sure on openbve forum it came out that only track section or something could be used for it, and im not too sure what this actually is? what does all that jargon do?
mrknowitall
mrknowitall

Posts : 824
Join date : 2011-07-09
Age : 31
Location : W. Yorkshire

Back to top Go down

OpenBVE Syntax highlighter for Notepad++ Empty Re: OpenBVE Syntax highlighter for Notepad++

Post by leezer3 Fri Sep 23, 2011 2:46 pm

mrknowitall wrote:am i right in saying this only works with a certain type of code? im sure on openbve forum it came out that only track section or something could be used for it, and im not too sure what this actually is? what does all that jargon do?

Not really Smile
In essence, anything after the with Track, statement should be highlighted nicely.
At the moment, there's an issue in that if it finds a keyword elsewhere (Comments basically), this gets highlighted, as it doesn't recognise a period as a valid character for keywords.

Install the plugin and open any CSV route, and you'll see Very Happy

Other than that it's reasonably complete.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1955
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

OpenBVE Syntax highlighter for Notepad++ Empty Re: OpenBVE Syntax highlighter for Notepad++

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum