WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Old FLTK Editor code?  (Read 2304 times)

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Old FLTK Editor code?
« on: October 25, 2021, 07:14:27 PM »
Are there any version of the default fltk editor in the repos that doesn't come with syntax highlighting?

(and would it even work considering we're on fltk 1.3.5 or 1.3.6 - I have to look that up)

Saw some threads about it in some older dCore threads, so maybe possible?  Performance hit?  I use all the features, preview, favorites and so forth, but sometimes the highlighting gets a bit distracting for my non-programming text files.
« Last Edit: October 25, 2021, 07:17:49 PM by PDP-8 »
That's a UNIX book! - cool  -- Garth

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Old FLTK Editor code?
« Reply #1 on: October 26, 2021, 03:32:20 AM »
The fltk_projects repo has the editor source, but no such version without syntax hl. You can disable it by editing the source and building it, but not sure how much you need to edit. May be enough to comment the w->editor->highlight_data() and textbuf->add_modify_callback(style_update, w->editor); lines.

I think it's an FLTK sample app, so you could try tracking it down in FLTK repos.
The only barriers that can stop you are the ones you create yourself.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11628
Re: Old FLTK Editor code?
« Reply #2 on: October 26, 2021, 09:41:51 AM »
Hi PDP-8
You don't say what architecture you are looking for, so Here's what you can try:

For x86:
Unpack  http://tinycorelinux.net/5.x/x86/tcz/Xprogs.tcz  and grab the editor program from there.
Get  http://tinycorelinux.net/5.x/x86/tcz/fltk-1.1.10.tcz  and the  .dep  file.

OR
Unpack  http://tinycorelinux.net/6.x/x86/tcz/Xprogs.tcz  and grab the editor program from there.
That version was compiled against fltk-1.3.

For x86_64 (same song, different verse):
Unpack  http://tinycorelinux.net/5.x/x86_64/tcz/Xprogs.tcz  and grab the editor program from there.
Get  http://tinycorelinux.net/5.x/x86_64/tcz/fltk-1.1.10.tcz  and the  .dep  file.

OR
Unpack  http://tinycorelinux.net/6.x/x86_64/tcz/Xprogs.tcz  and grab the editor program from there.
That version was compiled against fltk-1.3.

I don't know when the syntax highlighting was added. I'm certain the TC5 versions don't have it. I suspect the TC6
versions don't have it either.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 724
Re: Old FLTK Editor code?
« Reply #3 on: October 27, 2021, 12:22:23 AM »
If you are using 64-bit, there's a editor with shell highlighting on the repo.
There's a button to switch on and off the highlighting function.
It was written entirely from scratch with the help of the IDE called "fluid".
You can grab the code and check for early commits for cross reference.
Code: [Select]
Title:          editor4sh.tcz
Description:    A FLTK editor for sh / bash
Version:        git commit 9317831
Author:         polikuo
Original-site:  https://github.com/polikuo/editor4sh
Copying-policy: OpenSource
Size:           36K
Extension_by:   polikuo
Tags:           editor bash shell
Comments:       A simple FLTK editor for plain text and shell scripts
Change-log:     2021/03/23 First Version
Current:        2021/03/23 First Version

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Old FLTK Editor code?
« Reply #4 on: October 27, 2021, 04:28:54 AM »
Wow - thanks guys!

I'm running 12.0 64 bit only here on many machines, so I'll unarchive the tcz's you referenced and check them out.  Great tip Curaga and awesome links Rich.  Dillo handled 'em just fine with save-as.

Polikuo - just wow man!  I'm blown away.  And the the way you handled the toggle between highlighting is absolutely brilliant by changing to a slightly larger font for non-highlighted.  In fact, that larger font would also be the cool beans as an option to incorporate into TC itself.  Different discussion, but again - what I thought was a bug when toggling turned out to be a really cool feature.

That really helps me find those semicolons when they should be commas in my code!  :)

The only thing I miss is cut-n-paste in the menus.  I'll try the usual unix mouse keys to do that when I get back to the box.  I tried yank-yank-put, but that didn't work. hah.

Simply outstanding - thanks again.  It was there all along.  Lesson learned - take the time to read the descriptions!


That's a UNIX book! - cool  -- Garth

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11628
Re: Old FLTK Editor code?
« Reply #5 on: October 27, 2021, 09:51:17 AM »
Hi PDP-8
... The only thing I miss is cut-n-paste in the menus. ...
I've always considered menu driven copy, cut, and paste to be the equivalent of "busy work":
Highlight text with mouse
Move mouse up to click  Menu
Move mouse to click  Cut
Move mouse down to reposition cursor
Move mouse up to click  Menu
Move mouse to click  Paste

Personally, I prefer:
Right hand highlights text with mouse
Left hand hits  Ctrl-X  to cut text
Right hand repositions cursor with mouse
Left hand hits  Ctrl-V  to paste text
Eyes stay focused on the text being manipulated at all times

I do this even when editing with geany which will popup a menu when right clicking the mouse, because keeping
one hand on the keyboard is faster and less distracting.

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Old FLTK Editor code?
« Reply #6 on: October 27, 2021, 04:44:30 PM »
I agree with you completely.  I just think a menu dropdown to serve as a reminder of those keybindings would be helpful to newbs.

Then there's a set of the population like myself who tend to out-think themselves, and not seeing the keybinding reminder in a menu dropdown mistakenly
assume that it is not possible so don't even try.  Ask me how I know. :)

In like mind, maybe a ctl-q or how to quit - right now I just close the window with the window manager when I'm done.  Although recently I borked my own
onboot.lst file and removed the wm, so that wasn't possible without using xkill :)

Mousy-folk might not realize the unix way, of highlighting a word or line, moving and anchoring the cursor, and middle-clicking.  Not even a left-click needed.
Works like that in the standard editor too for you lurkers...

Anyway, Polkuo has done a fantastic job.  I could even see variations where perhaps one might not want syntax highlighting at all, but just dig the font size
change from large to small etc etc.  Many options.

To be sure, I love it as-is right now.  On my monitors custom-modeline half-res with xorg. (Curaga's tip)  OH, its a beauty!
That's a UNIX book! - cool  -- Garth