scite-hacking trying to add BaCon & HUG highlighting

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

scite-hacking trying to add BaCon & HUG highlighting

#1 Post by big_bass »

I hacked at the scite /scintilla properties tying to add BaCon & HUG highlighting


*Well some may have seen that I added Bacon /HUG Highlighting to geany and you can also compile from the geany GUI unofficially it was a hack (using a chainsaw) but it works nicely

but in order to someday (I hope) we can get an official Bacon /HUG highlighting for geany and scite
or at the least get the ball rolling in that direction

I thought this would be easier to do but it wasnt I spent three days just to get a simple hack going
there are a lot of files to look through but.. seeing it can be done may motivate someone
else
who likes to code in C and do it the "right way"

there are some really nice advantages using scite for the documentation of help pages
or how to's to see the highlighted keywords in your source code
you can export BaCon code to HTML ,RTF , PDF ,LaTeX, XML :D

I could have stripped out the properties files to reduce the size
but that would be counter productive for exporting all the code type highlighting
to HTML ,RTF , PDF ,LaTeX, XML

this is alpha-hacked feedback needed to improve things

*I will clean things up a bit then upload the modified sources with a diff*

Joe
Attachments
export-as .png
(40.69 KiB) Downloaded 583 times
scite-bacon-highlighting.png
(152.65 KiB) Downloaded 573 times
Last edited by big_bass on Fri 07 Oct 2011, 04:01, edited 3 times in total.

User avatar
GatorDog
Posts: 138
Joined: Tue 12 Sep 2006, 16:43

#2 Post by GatorDog »

big_bass,
this is alpha-hacked, feedback needed ...
How to change scite font and size? It's too small for my screen resolution setup.
I looked for a menu item and a .config file but could not find a way to change font and size.
The "use monospace font" option gives a very washed out/faded font.
From the scite help, I tried: SciTE "-font.base=font:Monospace,size:14"
but that produced odd behavior, invisible? text.
Edit: Found "font" in Options/Global settings, but no change, (restarted scite).
_______________________________

HUG and Bacon specific keywords are not highlighted yet?
For example, REPEAT, LOCAL, ENABLE, SHOW, READLN ...
LANGUAGE/FREEBASIC didn't seem to effect it.

Common basic keywords like IF, SELECT, CASE, REM, SUB, END, WHILE ... are highlighted.

Some variable string names highlighted, most are not.

And compile not implemented yet?

Scite seems a little sluggish in navigating a large program.

GatorDog

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#3 Post by big_bass »

Hey GatorDog

what I do for text size is the same I do for the browsers
and that is the old fashioned keyboard combo Ctrl + + or Ctrl --
to adjust the size quickly

I havent played around with the fonts yet but that should be documented
somewhere most likely in the global.properties ?

the main selling point of scite is making color coded files
for documentaion

I use geany for compiling and everyday work

I think it is possible to add a compile option because C code
has an option to compile its a matter of digging in a little deeper

the second reason is geany recomends you get a filetype
working for scite first then they can modify a new one for geany


thanks for trying I will work on all the points you suggested

I am learning more about this as I go



Joe

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#4 Post by vovchik »

Dear GatorDog and Joe,

I changed the global settings for font and other things (statusbar on, taskbar on, size etc). The font settinsgs are around line 402 of the Global options file:

Code: Select all

if PLAT_GTK
	font.base=font:!DejaVu Sans Mono,size:13
	font.small=font:!DejaVu Sans,size:11
	font.comment=font:!DejaVu Sans,size:13
	font.code.comment.box=$(font.comment)
	font.code.comment.line=$(font.comment)
	font.code.comment.doc=$(font.comment)
	font.code.comment.nested=$(font.comment)
	font.text=font:!DejaVu Sans,size:13
	font.text.comment=font:!DejaVu Sans,size:13
	font.embedded.base=font:!DejaVu Sans,size:13
	font.embedded.comment=font:!DejaVu Sans,size:13
	font.monospace=font:!DejaVu Sans Mono,size:13
	font.vbs=font:!DejaVu Sans Mono,size:13
I will also have a look regarding keywords and compile options for baCon in Scite.

Thanks Joe...

With kind regards,
vovchik

User avatar
GatorDog
Posts: 138
Joined: Tue 12 Sep 2006, 16:43

#5 Post by GatorDog »

Code: Select all

if PLAT_GTK
   font.base=font:!DejaVu Sans Mono,size:13
   font.small=font:!DejaVu Sans,size:11
   font.comment............
<snip>
Made all the difference in the world. :D
Had to use "Liberation Mono", evidently "DejaVu Sans Mono" not on my system.

The tabs spacing is rather large. Three tabs pretty much puts you half way across the page.
While editing, tried changing the tabs.

Code: Select all

# Indentation
tabsize=8
indent.size=8

to-

# Indentation
tabsize=3
indent.size=3
That didn't seem to effect it.

TTFN
rod

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#6 Post by big_bass »

hey guys
thanks for the help

I need to recompile from source again :?
but no problem I have some free time Friday

geany development

Code: Select all

We try to use an unmodified version of Scintilla -
 any new lexers or other changes should be passed on to 
the maintainers at http://scintilla.org. We normally update 
to a new Scintilla release shortly after one is made. See also scintilla/README.


the freebasic isnt working with the mods
it is getting the color from visual basic instead this is why
only some keywords are seen (this took me awhile to figure out)

but will keep at it this looks interesting
that you can modify the keywords
maybe we can make a super light Bacon only
viewer if we keep at it

edit this file to get a smaller box size
/usr/share/scite/SciTEGlobal.properties

Code: Select all

if PLAT_GTK
	position.left=5
	position.top=22
position.width=376
position.height=540
I took 200 off each the preset values they were 576 and 740
Joe

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#7 Post by big_bass »

http://www.murga-linux.com/puppy/viewto ... =72399here is the scite package I compiled and un edited sources except for the *.desktop file and used a slack.desc

http://www.puppy2.org/slaxer/scite-2.29-i486-2.tgz

this way we all start at the same place and all line numbers match up and we can diff to this
package /original sources so that we we have a clean reference point

Joe

its easier to write my own keyword generator and have it output phpbb code
so I can post in the forum here is a start
http://www.murga-linux.com/puppy/viewtopic.php?t=72399

*will come back to this and finish it off

Post Reply