Automatic splitting code across lines...

Working on new editor enhancements?
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Berikco: Seeing as your an Admin/Part of the PureBasic team, maybe you could speak to Freak/Fred about putting something like this actually in the editor for real. I don't think it could be too hard seeing the amount of code it takes?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

I can add the option, its no problem.
quidquid Latine dictum sit altum videtur
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

8) Thanks. It would be great if the colour and indent amount could be user definable.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
maw

Post by maw »

It would be perfect if the ident amount could be set to the same as the indent of the original line.
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

That's not available as an option in Scintilla. I prefer slighly indented more - thus the +16 indent.

If you join the official scintilla mailing list, you could suggest that as an option?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> SendMessage_(scintilla,#SCI_SETWHITESPACEFORE,#True,RGB($70,$50,$d0)) ; <- colour of marker

Excellent! I've set mine to #Red and now I can see it on my black IDE background.

> I can add the option

If you do, then please make sure you give all 3 options:

(1) Wrap enabled/disabled.
(2) Indent size, with 0 if the user wants.
(3) Color of visual arrows (the #Red I just mentioned above).

Even though it's not true line continuation, it makes a great way to quickly
toggle long lines to see the parts not currently visible, without having to use
the scrollbar or reach for the mouse. Anything time-saving like that is great!
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Nice going guys!

Now if you can hack in and force real split lines .... :)
Dare2 cut down to size
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Thanks. :)
Now if you can hack in and force real split lines
I think that the only real neat solution for that one will have to come from Fred himself and be built into the compiler.
(2) Indent size, with 0 if the user wants.
I think that if the indicator is at the start then this may have to be 1 (this may be automatic?):
Scintilla Docs! wrote:The indention of sublines is independent of visual flags, but if SC_WRAPVISUALFLAG_START is set an indent of at least 1 is used.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> if the indicator is at the start then this may have to be 1

Yes, but what I mean is to not force the user to have an indent of X or something.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

ic :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Freak: Do you think you will be able to put this in 4.30 (final) as an option?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Having the editor wrap is nice, but it doesn't solve the problem of posting
code here, where the long lines will still be long. A line continuation char
would still be the best solution (like space-underscore as in Visual Basic).
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5353
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Giant !!!
Thanks a lot 8)
ImageThe happiness is a road...
Not a destination
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 666
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: Automatic splitting code across lines...

Post by Kurzer »

This hack does not work with PB Version 4.50 :(
Is any new solution out there?
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
Amundo
Enthusiast
Enthusiast
Posts: 191
Joined: Thu Feb 16, 2006 1:41 am
Location: New Zealand

Re: Automatic splitting code across lines...

Post by Amundo »

This works in 4.51RC1.

I tried to set the indenting to follow on from the previous line, but failed :-(, using the following:

Code: Select all

  SendMessage_(scintilla,#SCI_SETWRAPINDENTMODE, 2, 0)  ; <-- indent mode
The "2" comes from:
SC_WRAPINDENT_INDENT 2 Wrapped sublines are aligned to first subline indent plus one more level of indentation
Win8.1, PB5.x, okayish CPU, onboard video card, fuzzy monitor (or is that my eyesight?)
"When the facts change, I change my mind" - John Maynard Keynes
Post Reply