PureSyntax Notepad++ Generator

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

PureSyntax Notepad++ Generator

Post by ts-soft »

PureSyntax_Notepad++.exe generates a syntax file for Notepad++ in the xml format.
Functionnames (incl. UserLibs) are determined by use of the PB-Compiler.

Sourcecode included.

Download

Feedback welcome

Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureSyntax Notepad++ Generator

Post by IdeasVacuum »

....ah, installs like a charm but the syntax highlighting does not want to work on my PC :( Notepad++ 5.8.6 Unicode. WinXP 32bit.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: PureSyntax Notepad++ Generator

Post by netmaestro »

Maybe you didn't create the language file correctly, it works here without problems.
BERESHEIT
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: PureSyntax Notepad++ Generator

Post by Vera »

Hi,

thanks for sharing :) (especially the code ;) )

I tested it and found the following:

- ElseIf is missing in Wordlist2

- the "- bondaries are not assigned (though working), as the quotes need to be in html-syntax and terminated twice:
change: <Keywords name="Delimiters">"00"</Keywords>
to: <Keywords name="Delimiters">"00"00</Keywords>

- " must be an active operator as well, otherwise the folding and highlightings are corrupted after e.g.:
("Open File",GetPathPart(CurrentFile),"Text files|"+TextExt+"|All files|*.*",0)
until the same 'error' occures the next time. You may test this:

Code: Select all

Macro OpenTextFile()
  If AskSaveFile()
    fname.s = OpenFileRequester("Open File",GetPathPart(CurrentFile),"Text files|"+TextExt+"|All files|*.*",0) 
    If fname : LoadFile(fname) : EndIf 
  EndIf 
EndMacro 
Hint: if you like to enhance the folding, make sure that the folding -+ keywords are not listed in the wortdlist-2 as well, otherwise they won't work.

@ IdeasVacuum

I too have no problem with this generated xml in the new unicode version. Have you used any userHighlighter before? Maybe it helps opening the internal np-styler and changing something to provoke a fresh saving/rewriting.

greetings ~ Vera
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureSyntax Notepad++ Generator

Post by IdeasVacuum »

:cry: Tried everything now, including your tip Vera. Uninstall-reinstall. Thought I was on to something there as Revo Uninstaller revealed a lot of app data files remain after uninstall. So, starting from a clean sheet, installed Notepad++, ran the ts-soft app, useDefinedLang.xml is installed directly into the np++ folder. Run np++, User-Defined is listed in the language menu but does nothing. All the built-in languages work.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: PureSyntax Notepad++ Generator

Post by netmaestro »

You have to create the new language definition and save it. Look in the notepad++ help under 'user defined language'. It explains how to use the user-defined dialogue from the toolbar to do this.
BERESHEIT
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureSyntax Notepad++ Generator

Post by ts-soft »

thx for feedback :D

Hint to Installation:
View / User-Defined Dialogue... / Import... is the easiest.
If you have a old pb-syntaxfile or update:
View / User-Defined Dialogue... / Select language / Remove before installation.
After Installation:
Open *.pb and
Language / PureBasic (this is only ones required)

@Vera
thx for bugreport, i am on it.

Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureSyntax Notepad++ Generator

Post by IdeasVacuum »

Ah, I did not know I had to View / User-Defined Dialogue... / Import.

Works like a charm now, thank you ts-soft! :wink:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureSyntax Notepad++ Generator

Post by ts-soft »

IdeasVacuum wrote:Works like a charm now, thank you ts-soft! :wink:
you are welcome :D

Update:
added ElseIf Keyword
small changes on delimiters

Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: PureSyntax Notepad++ Generator

Post by Vera »

Hi,

The boundaries appear allright now.
Btw: did you know that NP overwrites your neat xml-style ;)

- like I already suggested for " (quote), I would also suggest to add , (comma) as activated operator. This is the only way (in np) to make these characters work as highlight-delimiters. The following example shows the difference if s.o. doesn't use blanks:
DisplayPopupMenu(#contextMenu,WinHandle,WindowX(#mainWin)+100,WindowY(#mainWin)+100)
DisplayPopupMenu(#contextMenu, WinHandle, WindowX(#mainWin)+100, WindowY(#mainWin)+100)


@ IdeasVacuum
After reading the last postings I realize that you use the install version where the settings.xmls need to be under appdata. In case you'll ever want a version to run portable just place an empty doLocalConf.xml into the app-folder and supply your settings.xmls there as well.

cheers ~ Vera
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureSyntax Notepad++ Generator

Post by ts-soft »

Vera wrote:Hi,

The boundaries appear allright now.
Btw: did you know that NP overwrites your neat xml-style ;)
Is not my neat xml-style, this is the stringtranslation for xml in purebasic :wink:
Vera wrote: I would also suggest to add , (comma) as activated operator.
Done

Update:
Missing operator , added.

Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureSyntax Notepad++ Generator

Post by ts-soft »

Update:

+ Hexnumbers supported
+ set Consolas as default font on win-vista and higher
+ create optional a autocomplete file! *

* you have to enable the autocomplete feature in the settings of notepad++
save the "purebasic.xml" to:

Code: Select all

Debug GetEnvironmentVariable("ProgramFiles") + "\Notepad++\plugins\APIs"
greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
kenmo
Addict
Addict
Posts: 2042
Joined: Tue Dec 23, 2003 3:54 am

Re: PureSyntax Notepad++ Generator

Post by kenmo »

Nice!

This could be useful at one time or another...

Thank you for this.
Post Reply