Page 1 of 1

PureSyntax Notepad++ Generator

Posted: Mon Dec 20, 2010 3:33 pm
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

Re: PureSyntax Notepad++ Generator

Posted: Mon Dec 20, 2010 5:43 pm
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.

Re: PureSyntax Notepad++ Generator

Posted: Mon Dec 20, 2010 6:19 pm
by netmaestro
Maybe you didn't create the language file correctly, it works here without problems.

Re: PureSyntax Notepad++ Generator

Posted: Mon Dec 20, 2010 10:17 pm
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

Re: PureSyntax Notepad++ Generator

Posted: Mon Dec 20, 2010 11:34 pm
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.

Re: PureSyntax Notepad++ Generator

Posted: Mon Dec 20, 2010 11:59 pm
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.

Re: PureSyntax Notepad++ Generator

Posted: Tue Dec 21, 2010 12:02 am
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

Re: PureSyntax Notepad++ Generator

Posted: Tue Dec 21, 2010 12:06 am
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:

Re: PureSyntax Notepad++ Generator

Posted: Tue Dec 21, 2010 1:05 am
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

Re: PureSyntax Notepad++ Generator

Posted: Tue Dec 21, 2010 12:30 pm
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

Re: PureSyntax Notepad++ Generator

Posted: Tue Dec 21, 2010 4:17 pm
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

Re: PureSyntax Notepad++ Generator

Posted: Tue Dec 21, 2010 7:30 pm
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

Re: PureSyntax Notepad++ Generator

Posted: Tue Dec 21, 2010 7:53 pm
by kenmo
Nice!

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

Thank you for this.