GoScintilla - 2.7 (Purebasic 4.5 onwards)

Developed or developing a new product in PureBasic? Tell the world about it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by srod »

I am sorry, but I have spent enough time for now on your problems; including rummaging through your pm'd code once before, even though I did not request it.

If there is a bug with GoScintilla then I will fix it, but I require a bug report with something I can reproduce and not your entire application sent to me. Problems with your application are, quite honestly, not my concern. Post in the coding forums and if I have time then I shall take a look. Others might also be tempted to take a look as well.
I may look like a mule, but I'm not a complete ass.
gedumer
User
User
Posts: 48
Joined: Wed Jun 03, 2009 9:04 pm

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by gedumer »

I just discovered GoScintilla. Looks great.

Thanks srod...
Peyman
Enthusiast
Enthusiast
Posts: 203
Joined: Mon Dec 24, 2007 4:15 pm
Location: Iran

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by Peyman »

hi srod,
i find something but i dont know this is a bug or have some work for every lang:
for statement in lua is ended with do but is a statement for examp :
do statement :

Code: Select all

do
  -- Do Something
end
for statement :

Code: Select all

for i=0, 10 do
  -- Do Something
end
so when i write a for statement in GoScintilla, it search for two end for folding instead of one, i think because of for and do in one line if not what is problem ?
thanks for your time.
Sorry for my bad english.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by srod »

Not a bug, a limitation. GoScintilla allow's for multiple open-fold / close-fold keywords on the same line etc.

You would have to remove either the keyword 'do' or 'for' from code folding and then use a user-defined line styling function to deal with the removed keyword etc.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by srod »

@Peyman : I have updated GoScintilla 2 (version 2.2) to offer you a part solution for your predicament which means that you may not have to resort to a user-defined line styling function.

I have added a new keyword style : #GOSCI_OPENFOLDKEYWORDNOPRECEDING. This marks a keyword (or multiple keywords) as an open-fold keyword with the proviso that it will only open a new fold on any given line if this symbol is not preceded by any other open-fold keyword. That is, if the line is not already marked as being the start of a new fold etc.

This should solve your problem.

I say 'should' because GoScintilla does not respect line separators such as the ':' symbol which we can use with Purebasic. This means that, for example, in the following line :

Code: Select all

for i=0, 10 do : do
  -- Do Something
end : end
if 'do' is marked as a #GOSCI_OPENFOLDKEYWORDNOPRECEDING keyword then the 2nd 'do' on the first line will not contribute an additional open-fold even though it is (because of the : ) essentially on a new line etc.

Course I do not know if LUA supports this kind of thing anyhow! :)

I will probably modify GoScintilla at some point so that it does recognise line separators, but it is not something I am in need of right now.

I hope this helps?


@ALL : new version of GoScintilla 2 is available... as described above! :)
I may look like a mule, but I'm not a complete ass.
Peyman
Enthusiast
Enthusiast
Posts: 203
Joined: Mon Dec 24, 2007 4:15 pm
Location: Iran

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by Peyman »

@srod : Thanks many times, this new flag very can help,
and yea in lua this possible with ';' so code is

Code: Select all

for i=0, 10 do ; do
  -- Do Something
end ; end
Another time thanks.
Sorry for my bad english.
Szafir
New User
New User
Posts: 5
Joined: Mon Oct 12, 2009 11:47 am

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by Szafir »

How to make a block with the comment:


Rem
comment
comment
comment

EndRem

Sorry my bad English.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by srod »

You need a user-defined line styling function.

See the AdvancedDemos\BlockComments\BlockCommentStyler.pb demo.

This one uses c-style block comments. Should be easy to alter to give what you are after.
I may look like a mule, but I'm not a complete ass.
Szafir
New User
New User
Posts: 5
Joined: Mon Oct 12, 2009 11:47 am

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by Szafir »

It will be difficult. It is a pity that there is no ready-made functions.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by srod »

Szafir wrote:It will be difficult. It is a pity that there is no ready-made functions.
Scintilla is a complicated beastie and the business of syntax styling and the like is... not easy! At the end of the day there are only so many functions and so much functionality I can add to GoScintilla before it becomes just as difficult to use as Scintilla itself and GoScintilla cannot possibly cater for every possible situation etc. I think it does okay in its present form.

Beside's, with a user-defined line styling function there is literally nothing you cannot do. You just have to roll your sleeves up and study the demos which use such functions. You may even need to read up a little on the Scintilla api as well, but that's the price of being a developer I'm afraid.

Treat it as a learning experience. :)
I may look like a mule, but I'm not a complete ass.
Szafir
New User
New User
Posts: 5
Joined: Mon Oct 12, 2009 11:47 am

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by Szafir »

GoScintilla is really easy, it is better not to complicate it too much.
I am using GoScintilla write a small project: BMIde - Mini BlitzMax Editor.

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

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by srod »

Looks nice - well done.
I may look like a mule, but I'm not a complete ass.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by eddy »

:arrow: download link: http://pbsci.svn.sourceforge.net/viewvc ... z?view=tar

here is a PB syntax advanced demo. :)
  • Hex number style
  • Binary number style
  • .Structure style
  • Procedure style
  • Procedure region highlighting
  • Custom code folding between ;{ and ;} markers
I used two custom functions :

Code: Select all

Procedure GOSCI_SetLineHighlightColor(id, color)
Procedure GOSCI_SetLineHighlighted(id, lineIndex, flag=#True)
Image
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
drgolf
Enthusiast
Enthusiast
Posts: 106
Joined: Tue Mar 03, 2009 3:40 pm
Location: france

how to detect scn_modified

Post by drgolf »

Hello,
Sorry if my question is already solved :
How can i know if the text in my scintilla gadget is modified ?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: how to detect scn_modified

Post by ts-soft »

drgolf wrote:Hello,
Sorry if my question is already solved :
How can i know if the text in my scintilla gadget is modified ?

Code: Select all

ProcedureDLL ScintillaCallBack(Gadget, *scinotify.SCNotification)
  Select *scinotify\nmhdr\code
    Case #SCN_MODIFIED
      Debug "modified"
  EndSelect
EndProcedure
Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply