SciTE editing color syntax

Linux specific forum
Linux Lunatyk
User
User
Posts: 15
Joined: Sun Apr 18, 2004 8:01 pm
Location: Conroe TX

SciTE editing color syntax

Post by Linux Lunatyk »

Editing PB code with syntax highlighted. It is actually based on the original SciTE and some other user's contribution and modified to work in my SuSE system. I should say that it isn't cleaned and I'm not real knowledgeable regarding SciTE configuration files although it is my favorite editor.

{ My apologies for the original (long) post. I thought this would be a simple, read only post. It wound up being a PITA. Please use the url's provided to access the ScITE files.

http://www.dcnet2000.com/~quazar/pub/pb ... properties
http://www.dcnet2000.com/~quazar/pub/pb ... properties

Cheers,
Mike T.
Last edited by Linux Lunatyk on Tue Aug 24, 2004 3:37 pm, edited 1 time in total.
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post by Beach »

I had no trouble getting this to work on Mandrake 10 using version 1.58 of SciTE. Thank you!
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post by Beach »

If you want to compile your app in SciTE using the F5 key, change the following line:
if PLAT_GTK
command.go.*.pb="pbcompiler $(FilePath)"
to
if PLAT_GTK
command.go.*.pb=pbcomplier "$(FilePath)"
This will create a file called "purebasic.exe" in the directory where your script is located. I created a bash script that can be used with SciTE to change the file produced to be the name of the script with the extention of ".pbe". It will also execute the file so it will behave as it does when using 'pbcomplier'

file name I used 'buildpb.sh'

Code: Select all

#!/bin/sh
cmdstring=${1}
cmdlen=${#cmdstring}
ext=${cmdstring:cmdlen-3:3}
if [ ${ext} == ".pb" ]; then
	outfile=${cmdstring:0:cmdlen-2}"pbe"
fi
echo ${outfile}
pbcompiler ${1} -e ${outfile}
${outfile}
Create the file in your /usr/bin directory then change SciTE's pb.properties file as suggested above:
if PLAT_GTK
command.go.*.pb=buildpb.sh "$(FilePath)"
-Beach
Linux Lunatyk
User
User
Posts: 15
Joined: Sun Apr 18, 2004 8:01 pm
Location: Conroe TX

Post by Linux Lunatyk »

Now all we need is someone to write a real 'lexer' so stuff like folding, et.al works. It requires some C++ coding and I don't use that language.

Any takers? Please!
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

GPI appears to have already written such a lexer for jaPBe, and in PB too. Perhaps you could lift that.

I understand that jaPBe itself is window's only, but that particular code could probably be made cross-platform easily enough.

Download the source and look at editor-core.pbi.
Linux Lunatyk
User
User
Posts: 15
Joined: Sun Apr 18, 2004 8:01 pm
Location: Conroe TX

Post by Linux Lunatyk »

I'll give it a try but I think the lexer for ScITE is somewhat different than one for an editor running in Windows.

Cheers,
Mike T.
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Linux Lunatyk,

jaPBe uses Scintilla, the same as scite.

It should all be cross platform.
Linux Lunatyk
User
User
Posts: 15
Joined: Sun Apr 18, 2004 8:01 pm
Location: Conroe TX

Post by Linux Lunatyk »

GedB wrote:jaPBe uses Scintilla, the same as scite.

It should all be cross platform.
Would be it were that easy. :)

Ok, I installed JaPBE in a Windows/VmWare with the source. What I see so far is a SciLexer.dll in the exe's directory but I cannot locate the actual source code for this. I have found code which utilizes the lexer but not the lexer code itself. Even with the code, it might not be easy to port to Linux based on what little I know of Scintilla or C/C++ for that matter.

If you can figure this out and/or get the code it might help. At this point I don't need the extra features myself. It's just a matter of completeness.

Cheers,
Mike T.
Linux Lunatyk
User
User
Posts: 15
Joined: Sun Apr 18, 2004 8:01 pm
Location: Conroe TX

color syntax & folding

Post by Linux Lunatyk »

FWIW, there is a complete syntax/fold file for the KDE Kate editor at the kate site. Use menu, Configure Kate select the Highlighting item in the tree list then click the download.

Ok, perhaps it's not complete as it was for 3.8 but still, it's very useful for those who don't mind KDE.

Cheers,
Mike T.
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post by Beach »

Kate sounds good. I would like to see SciTE do it though, I do not have KDE on some of my machines. The required space for SciTE is lighter as well when you consider Kate will need the KDE base files to run (at least that is what I assume). I think I will give the mailing list a try at the Scintilla site. I'll report back if I find anything.
Linux Lunatyk
User
User
Posts: 15
Joined: Sun Apr 18, 2004 8:01 pm
Location: Conroe TX

Post by Linux Lunatyk »

Beach wrote:Kate sounds good. I would like to see SciTE do it though, I do not have KDE on some of my machines. The required space for SciTE is lighter as well when you consider Kate will need the KDE base files to run (at least that is what I assume). I think I will give the mailing list a try at the Scintilla site. I'll report back if I find anything.
Yes, Kate/KDE uses a lot of resources but has some interesting possibilities. You have access to browsing files, a terminal for building your prog's (or other things) and multiple open files. In my case, I added 2 small scripts (in ~/bin) to ease the typing of long file names. These can also be used in any terminal. I sometimes use them in Midnight Commander.

Code: Select all

#run filename (no extension) = build and execute the program (filename).
  pbcompiler $1.pb -e $1
  ./$1

Code: Select all

#pbc filename (no extension) = compile the code file (filename)
  pbcompiler $1.pb -e $1
Cheers,
Mike T.
Linux Lunatyk
User
User
Posts: 15
Joined: Sun Apr 18, 2004 8:01 pm
Location: Conroe TX

another scintilla based editor.

Post by Linux Lunatyk »

I've not spent much time with this but it looks promising. It has built in python scripting for more advanced options. It doesn't handle the color for PureBasic yet and any help here would be appreciated. You can find it by the provided link or simply 'google' for 'cute scintilla editor'

http://www.icewalkers.com/Linux/Softwar ... /CUTE.html

Hope this helps someone. Perhaps we can make it a useable PB editor.

Cheers,
Mike T.
The_Pharao
User
User
Posts: 57
Joined: Sun Jan 04, 2004 2:11 pm

Post by The_Pharao »

how can i help?

i would love to have a proper editor for PB in linux!
The_Pharao
User
User
Posts: 57
Joined: Sun Jan 04, 2004 2:11 pm

Post by The_Pharao »

ok, i asked GPI if he wrote a lexer for scintilla that could be used for scite, too. he answered, that he wrote his own routines for japbe because he did not understand how the scite/scintilla lexer thing works.
so... how can we get an editor to work for linux, then?
Linux Lunatyk
User
User
Posts: 15
Joined: Sun Apr 18, 2004 8:01 pm
Location: Conroe TX

Linux PB editor

Post by Linux Lunatyk »

Sorry, been offline for a little while, health problems.

I haven't had much time to really look into this. The necessary info should be on the Scintilla/Scite website. It will require some reading (IME). You may need info from the PureBasic doc's or perhaps the Kate editor/PureBasic file. Sadly, I can't spend much time on this right now. Temporarily stuck in a Wndows world :(

Cheers,
Mike T.
Post Reply