GoScintilla - 2.7 (Purebasic 4.5 onwards)

Developed or developing a new product in PureBasic? Tell the world about it.
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Re: GoScintilla - 2.0 (beta 4)

Post by LCD »

Big thanks!!!
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: GoScintilla - 2.0 (beta 4)

Post by ts-soft »

New wish :wink:

Can you add some scintilla searchfunction to easy searching/replacing with selecting?
(Supporting RegEx?)

greetings
Thomas
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: GoScintilla - 2.0 (beta 4)

Post by ts-soft »

Problem with PB 4.50 RC 1 = IMA

GoScintilla.pbi line 187: "*this\keywordPtr() = *ptrKeyword"

greetings
Thomas
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.0 (beta 4)

Post by srod »

ts-soft wrote:Problem with PB 4.50 RC 1 = IMA

GoScintilla.pbi line 187: "*this\keywordPtr() = *ptrKeyword"

greetings
Thomas
A bug with PB by the look of it.

http://www.purebasic.fr/english/viewtop ... 77#p324777
I may look like a mule, but I'm not a complete ass.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: GoScintilla - 2.0 (beta 4)

Post by Trond »

There is a problem with backspace and code completion (the popup window opens and closes for every other backspace).

And the right-click menu isn't positioned 100% at the pointer.

Just testing it a bit, looks nice.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.0 (beta 4)

Post by srod »

Trond wrote:There is a problem with backspace and code completion (the popup window opens and closes for every other backspace).

And the right-click menu isn't positioned 100% at the pointer.

Just testing it a bit, looks nice.
The context menu belongs to Scintilla and is nothing to do with me. :)

Scintilla's code-completion lists and call-tips do have some 'quirks' which I have mentioned previously somewhere in this thread. The backspace issue is one of them. I did investigate this one quite a bit and there is no good reason that I can see why the list does not appear on every other backspace etc. Certainly, GoScintilla 2 sends the relevant messages at the correct time (have just checked once more). It is a mystery and something, I think, we are going to have to live with. The PB IDE of course does not use Scintilla's code-completion lists.

**EDIT : if Scintilla's code-completion lists do prove un-satisfactory for many then I shall consider following Freak's lead and roll my own implementation. Personally, I can live with the various quirks though.
I may look like a mule, but I'm not a complete ass.
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Re: GoScintilla - 2.0 (beta 4)

Post by LCD »

One wish: I try to use a marker (Arrows) to show the line where error occurs, so I defined the marker and wanted to display it, but it is not displayed (I use the code from a version before I started to use GoScintilla, which was working previously). I think, folding markers overwrite my error marker, but the same problem exists outside of folds. Can you add a way to display the markers?
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.0 (beta 4)

Post by srod »

LCD wrote:One wish: I try to use a marker (Arrows) to show the line where error occurs, so I defined the marker and wanted to display it, but it is not displayed (I use the code from a version before I started to use GoScintilla, which was working previously). I think, folding markers overwrite my error marker, but the same problem exists outside of folds. Can you add a way to display the markers?
Please read the manual (GoScintilla 2) - Additional section --> Bookmarks.

There are two margins which GoScintilla 2 does not make use of : #GOSCI_MARGINUSER1 and #GOSCI_MARGINUSER2. Use either of these for your own markers.

In addition, GoScintilla 2 uses marker index 0 for bookmarks and so you should steer away from this index. Use any index from 1 to 31.

And that is all you need to know. Apart from this, just use markers as you would with any Scintilla control.

For example, the following little snippet shows how you might use margin #GOSCI_MARGINUSER1 for a marker (index 1). I color the marker symbol red :

Code: Select all

GOSCI_SetMarginWidth(id, #GOSCI_MARGINUSER1, 20)
ScintillaSendMessage(id, #SCI_SETMARGINMASKN, #GOSCI_MARGINUSER1, 1<<1)  ;Only marker number 1 to be allowed.
ScintillaSendMessage(id, #SCI_MARKERDEFINE, 1, #SC_MARK_SHORTARROW)
ScintillaSendMessage(id, #SCI_MARKERSETBACK, 1, #Red)
Note that the default width of the #GOSCI_MARGINUSER1 margin is zero. If you keep it at zero then adding a marker to this margin has the effect of coloring the entire line etc. which can be quite useful.

Add the marker to line 0 with the following :

Code: Select all

ScintillaSendMessage(id, #SCI_MARKERADD, 0, 1)
I have tested and it works fine.
I may look like a mule, but I'm not a complete ass.
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Re: GoScintilla - 2.0 (beta 4)

Post by LCD »

Yes, it works... A case of RTFM... :D
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Re: GoScintilla - 2.0 (beta 4)

Post by LCD »

Is it possible to create two independent lexers for the same source code? I want to make ASM / END ASM Block with a completly different lexers. My problem is: SUB / END SUB is defined as SUBroutine and create folding points, but there is also SUB in Assembly language, but it must not create folding points. Also I tried to mix multiwords with multiline comments, but it did not work. I understand some of the GoScintilla Code, but MyLexer is black magic yet.
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: GoScintilla - 2.0 (beta 4)

Post by ts-soft »

Adding a Keyword for folding on the fly is no problem, but remove a keyword only from folding?

greetings
Thomas
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.0 (beta 4)

Post by srod »

ts-soft wrote:Adding a Keyword for folding on the fly is no problem, but remove a keyword only from folding?

greetings
Thomas
At the moment, the only way of accomplishing that is to use GOSCI_RemoveKeywords() to completely remove the appropriate keywords and then to add them again using GOSCI_AddKeywords() or GOSCI_AddKeywordsEx(), but omitting the #GOSCI_OPENFOLDKEYWORD flag etc. Make sure that you also remove the corresponding close fold keywords etc.
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: GoScintilla - 2.0 (beta 4)

Post by ts-soft »

thx for your answer, but i think i can't go this way, but i will a bit more testing :wink:
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.0 (beta 4)

Post by srod »

Off hand I cannot think of any reason why this should not work in any circumstance.

The thing about AddKeywords() is that the keywordFlags parameter is OR'd with any existing value for that keyword and so there is no way, at present, to remove individual bit values (such as #GOSCI_OPENFOLDKEYWORD). I did this for reason linked to global call-tip separators.

Well, there is one way to alter the keywordFlags values at the individual bit level...

... use the GOSCI_GetKeywordInfo() function to retrieve a pointer to the keyword's GoScintillaKeyword structure. One of these fields (flags) is what you are after. Alter this value as you see fit, e.g. remove the #GOSCI_OPENFOLDKEYWORD.

The problem now is that you need to force Scintilla to then restyle the document. The are various ways of bullying GoScintilla into forcing a complete restyle. The best way is to use GOSCI_RemoveKeywords() and remove a non-existant keyword; e.g.

Code: Select all

GOSCI_RemoveKeywords(#myID , "XXX")
I have tested and this all works fine.
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: GoScintilla - 2.0 (beta 4)

Post by ts-soft »

thx, all works fine :D
Post Reply