Background color of IDE

Post bugs related to the IDE here
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Background color of IDE

Post by BarryG »

I opened the IDE today (5.72 32-bit), and I have it set to a black background, and before I typed anything I clicked the "Save" icon to save the source as a blank file before I intended to start typing. However, this made the background color of the IDE turn the default yellow color after the save occurred!

Further, opening that blank saved file opens it with that yellow background, but opening an existing source opens it as black (as per my Prefs settings).

[Edit] Just worked out why: the filename saved from the IDE has no file type, so it doesn't have a ".pb" extension. Needs a bug fix.
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: Background color of IDE

Post by Kurzer »

No, this is not a bug, BarryG.

The IDE distinguishes between a code file (.pb, .pbi) and a "text file" (all other file extensions).
So the IDE can also be used as a text editor. For both modes an own background color can be set.

Have a look at the settings under Editor / Colors, this should be the 4th entry or something like that.

Greeteings, Kurzer
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 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Background color of IDE

Post by BarryG »

If I start PureBasic and enter some source code, then click "Save", type a name and hit Enter, the file is saved without the ".pb" extension. It saves with no extension at all, yet I'm trying to save a PureBasic program. Am I supposed to seriously add ".pb" manually every time I save a new source?

The IDE's "Save" dialog box defaults to "All files (*.*)" type, but it should default to "PureBasic Sourcecodes (*.pb)" so the user doesn't have to manually select that. If people want to use the IDE as a general text editor, then they should need to specify their desired extension manually instead; not the other way around.

I liken this to Notepad not saving text with ".txt" extensions, even though that's the default goal. Notepad can be used to create ".bat" files and ".vbs" files, but it still defaults to ".txt" as it should. The PureBasic IDE should default to ".pb" likewise.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Background color of IDE

Post by Paul »

BarryG wrote:If I start PureBasic and enter some source code, then click "Save", type a name and hit Enter, the file is saved without the ".pb" extension. It saves with no extension at all, yet I'm trying to save a PureBasic program. Am I supposed to seriously add ".pb" manually every time I save a new source?
Just click "Save As" and set 'Save as type' to "PureBasic Files (*.pb, *pbi, *pbp, *,pbf)" ... the first option in the drop list, then save your file.
The IDE will remember this setting. Close the IDE and then reopen and click "Save As" and you will see the file type is now always "PureBasic Files (*.pb, *pbi, *pbp, *,pbf)"

:)
Image Image
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Background color of IDE

Post by BarryG »

Thanks Paul; that fixed it. Now clicking "Save" (not "Save as") will also default to ".pb" type. Perfect.

But that still leaves a question: why doesn't the IDE default to ".pb" in the first place? I still say it's a (minor) bug, for the same reason I gave for Notepad above.
User avatar
kenmo
Addict
Addict
Posts: 1967
Joined: Tue Dec 23, 2003 3:54 am

Re: Background color of IDE

Post by kenmo »

BarryG wrote:But that still leaves a question: why doesn't the IDE default to ".pb" in the first place? I still say it's a (minor) bug, for the same reason I gave for Notepad above.
The IDE definitely does default to ".pb" :) I just tested it by resetting to "factory default" (renamed my PureBasic.prefs to a backup name, and reopened the IDE, with all default settings).

As Paul said, the IDE remembers your last selection. Surely you changed the dropdown, maybe by accident, or saved a file with a non-pb extension.
Post Reply