Windows PureBasic IDE with latest additions

Working on new editor enhancements?
User avatar
HeX0R
Addict
Addict
Posts: 980
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Windows PureBasic IDE with latest additions

Post by HeX0R »

I guess I got it, and bad news is, it was indeed my fault...
https://github.com/fantaisie-software/p ... /197/files

ProjectManagement.pb 1748...1753.
Here I change the current FileList() Element, that block has to be surrounded by PushListPosition() and PopListPosition().

To recreate it:
Create a new project, go to Files tab and add a new file, click on "create project" and close the IDE
But the compiled IDE doesn't seem to freak-out, maybe only in Windows 11


=> https://github.com/fantaisie-software/p ... c/pull/219
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Windows PureBasic IDE with latest additions

Post by ChrisR »

Thanks HeX0R for the quick Push(Pop)ListPosition(FileList()) fix.
However, with or without the fix, I do not reproduce the crash by following your indications.
Also tested with latest Windows_11_22H2 French_x64v1.iso updated to 22621.674 in a Virtual Machine.

I have updated PureBasic_IDE_Win_x64(x86)_2022-10-23.zip on the 1st post with your fix included.
User avatar
HeX0R
Addict
Addict
Posts: 980
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Windows PureBasic IDE with latest additions

Post by HeX0R »

Here is a video, that shows the effect and the procedure:
https://hex0rs.coderbu.de/Sonstiges/pb/ ... -58-13.mp4
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Windows PureBasic IDE with latest additions

Post by ChrisR »

Thanks for the video.
I reproduce it in debug mode and your Push(Pop)ListPosition fixes it. Would be good to have a confirmation from Denis too.
I was surprised not to have the crash with the compiled exe.

Image


Not really related to this correction, to avoid warnings in the log: [WARNING] SourceManagement.pb (Line: 1813) [WARNING] The specified file does not exist.
In SourceManagement.pb at line 1813, it would be nice to add a test on DiskFileSize:

Code: Select all

      *ActiveSource\DiskFileSize  = FileSize(*ActiveSource\Filename$)
      If *ActiveSource\DiskFileSize
        *ActiveSource\DiskChecksum  = FileFingerprint(*ActiveSource\Filename$, #PB_Cipher_MD5)
      EndIf
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: Windows PureBasic IDE with latest additions

Post by Denis »

ChrisR,

give me a link to the ide exe file (x86-64), otherwise I have to find where to go and how to compile, which I am not used to doing (surtout par flemme...)
A+
Denis
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Windows PureBasic IDE with latest additions

Post by ChrisR »

Salut Denis,
The links have been updated on the 1st post with HeX0R fix included.
Thanks for your feedback :)
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: Windows PureBasic IDE with latest additions

Post by Denis »

It seems to be OK x86/x64
If the bug comes back, I'll let you know.

Thank you HeX0R for your efforts.
A+
Denis
User avatar
Caronte3D
Addict
Addict
Posts: 1025
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Windows PureBasic IDE with latest additions

Post by Caronte3D »

Thanks! Now the x86 download nicely (without virus warnings)
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Windows PureBasic IDE with latest additions

Post by ChrisR »

So surprising these antivirus :shock:
A PushListPosition and PopListPosition and the false alarm is gone.
They must have a Shifumi game algorithm to choose between positive or not. It's crazy how unreliable they are :twisted:

On VirusTotal, there are 4 false alarms for the x86 version (minor AV) and 0 for the x64 version.
dibor
Enthusiast
Enthusiast
Posts: 125
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: Windows PureBasic IDE with latest additions

Post by dibor »

Hi.
Have download latest dev source.
While compiling on x64 Windows 10 machine I got error:
Error: in included file '.................................................\PureBasicIDE\CompilerFlags.pb'
Line 123 - Constant not found: #PB_Processor_Arm64.

What to do?

Thank U
Mac Studio M1Max, PB 6.03Arm64 and x64.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
AZJIO
Addict
Addict
Posts: 1312
Joined: Sun May 14, 2017 1:48 am

Re: Windows PureBasic IDE with latest additions

Post by AZJIO »

If you make a text replacement in the entire document, and 1000 replacements occur, then the cancellation must be performed 1000 times. If you click "Insert structure" into the code from the library of structures, then the cancellation is also performed one line at a time.

This code does the undo at a time.

Code: Select all

ScintillaSendMessage(SciGadget, SCI_BEGINUNDOACTION)
; multiple commands
ScintillaSendMessage(SciGadget, SCI_ENDUNDOACTION)
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Windows PureBasic IDE with latest additions

Post by ChrisR »

Hi AZJIO,
I'm not sure this is the best place in this thread for your request. This topic was just here to share the IDE with the latest improvements while waiting for the next PB version.
It would be nice indeed after a Replace All, that undo is done in one go.
It would be better in Feature Requests and Wishlists
AZJIO
Addict
Addict
Posts: 1312
Joined: Sun May 14, 2017 1:48 am

Re: Windows PureBasic IDE with latest additions

Post by AZJIO »

I managed to change and compile the IDE.
1. downloaded here (button "<> Code" -> Download zip)
2. Searched for "*Viewe", found "StructureViewer.pb" - 32 kb. Find the #GADGET_StructureViewer_InsertStruct and #GADGET_StructureViewer_InsertCopy events.
3. Before the block with calls to the InsertCodeString() functions add SendEditorMessage(#SCI_BEGINUNDOACTION, 0, 0), and after the block add SendEditorMessage(#SCI_ENDUNDOACTION, 0, 0)
4. Check that there is no ProcedureReturn in the block between calls.

Compilation
1. In the file \purebasic-devel\PureBasicIDE\MakeWindows.cmd add "pause" to the end of the file to see if there were any errors.
2. Make a copy of the "PureBasic" folder and drag this folder onto the "MakeWindows.cmd" file. The path to the "PureBasic" folder should not contain spaces and, just in case, only Latin letters. The path to the "purebasic-devel" folder is also without spaces.
3. After compilation, PureBasic.exe should change in the folder, the date of this file has changed to the current date. I checked that the insertion of the structure and the cancellation were performed as I wanted - with one click.
AZJIO
Addict
Addict
Posts: 1312
Joined: Sun May 14, 2017 1:48 am

Re: Windows PureBasic IDE with latest additions

Post by AZJIO »

Line 194 in FindWindow.pb, replaced FindText(3) with

Code: Select all

SendEditorMessage(#SCI_BEGINUNDOACTION, 0, 0)
FindText(3)
SendEditorMessage(#SCI_ENDUNDOACTION, 0, 0)
Now after "Replace all" the cancellation is done with one click.
Download (x64)
Should I make a separate topic to separate the official release from homemade?

I noticed that the replacement is done by selecting text (line 3897 in ScintillaHighlighting.pb).

Code: Select all

SendEditorMessage(#SCI_SETSEL, Find\chrgText\cpMin, Find\chrgText\cpMax)
SendEditorMessage(#SCI_REPLACESEL, 0, *ReplaceString)
I used this option

Code: Select all

ScintillaSendMessage(#SciGadget, #SCI_SETTARGETRANGE, firstMatchPos + lengthStr, firstMatchPos)
If flag & #SCFIND_REGEXP
	length2 = ScintillaSendMessage(#SciGadget, #SCI_REPLACETARGETRE, -1, *Replace)
Else
	length2 = ScintillaSendMessage(#SciGadget, #SCI_REPLACETARGET, -1, *Replace)
EndIf
but you need to shift the search range for #SCI_SEARCHINTARGET

Code: Select all

ScintillaSendMessage(#SciGadget, #SCI_SETTARGETSTART, inSrt)
ScintillaSendMessage(#SciGadget, #SCI_SETTARGETEND, inEnd)  
and by the way, this does not move the cursor position during text replacement.
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Windows PureBasic IDE with latest additions

Post by ChrisR »

AZJIO wrote: Thu Dec 08, 2022 2:04 pm Line 194 in FindWindow.pb, replaced FindText(3) with

Code: Select all

SendEditorMessage(#SCI_BEGINUNDOACTION, 0, 0)
FindText(3)
SendEditorMessage(#SCI_ENDUNDOACTION, 0, 0)
Now after "Replace all" the cancellation is done with one click.
Should I make a separate topic to separate the official release from homemade?
Good to have the undo/redo done in one Go, after a "Replace All", it works well, thanks :)
Maybe you can push a Pull requests

Edit: I've added a Pull Request: Replace All Undo/Redo #221
Post Reply