PB IDE Smart Highlight (showing selected text) implementatio

Just starting out? Need help? Post your questions and find answers here.
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 796
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: PB IDE Smart Highlight (showing selected text) implement

Post by Zebuddi123 »

@ Tenaja thanks for bringing the question to the forum :D

@ Danilo
Works great Just what the doctor ordered !!!
Thanks for sharing

Zebuddi. :D
malleo, caput, bang. Ego, comprehendunt in tempore
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: PB IDE Smart Highlight (showing selected text) implement

Post by c4s »

Does this code http://www.purebasic.fr/english/viewtop ... 36#p381036 (from May 17, 2012 6:52 pm) work without modifying Scintilla.dll?

I'm asking because I compiled it in Unicode, installed it as an IDE tool with the %TEMPFILE argument and assigned a shortcut - and it doesn't work. Any ideas?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: PB IDE Smart Highlight (showing selected text) implement

Post by Danilo »

c4s wrote:Does this code http://www.purebasic.fr/english/viewtop ... 36#p381036 (from May 17, 2012 6:52 pm) work without modifying Scintilla.dll?

I'm asking because I compiled it in Unicode, installed it as an IDE tool with the %TEMPFILE argument and assigned a shortcut - and it doesn't work. Any ideas?
Works here with original PB Scintilla.dll

"%TEMPFILE" argument should have double quotes, and it works only with the word under the cursor, not with selections.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: PB IDE Smart Highlight (showing selected text) implement

Post by c4s »

Ah, of course the double-quotes... now it works.

There are a few problems though: The selection doesn't go away, sometimes the shortcut doesn't work or not all occurrences will be selected.
Fortunately I was able to fix this by also enabling "Wait until tool finishes" and the selection can be cleared by highlighting no word. ;)

Later I'll try your selection-based version too (where Scintilla.dll has to be updated) as it seems to be an even greater improvement for the IDE!

Thank you Danilo, well done!


Edit:
Wait, I just noticed that http://www.purebasic.fr/english/viewtop ... 91#p381091 (from May 18, 2012 3:52 pm) works without modifying Scintilla.dll (but still needs the "%TEMPFILE" argument)!
The clear advantage over the previous code I've linked to, is that I'm now able to use selections. It even works for multiple words! 8)
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: PB IDE Smart Highlight (showing selected text) implement

Post by Danilo »

c4s wrote:Edit:
Wait, I just noticed that http://www.purebasic.fr/english/viewtop ... 91#p381091 (from May 18, 2012 3:52 pm) works without modifying Scintilla.dll (but still needs the "%TEMPFILE" argument)!
Not possible, as the code does not use %TEMPFILE (ProgramParameter(0)). :)

The code before (Fri May 18, 2012 12:24am) could work with old Scintilla.dll and "%TEMPFILE", but you can only use the first 7 styles.

I use the following style with the latest in-memory code:

Code: Select all

style = #INDIC_STRAIGHTBOX

color = RGB($00,$FF,$FF)

InnerAlpha  =  50
BorderAlpha = 200

#IGNORE_CASE = #True
AFAIK #INDIC_STRAIGHTBOX does not work with PureBasic's original Scintilla.dll
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: PB IDE Smart Highlight (showing selected text) implement

Post by c4s »

@Danilo
How would Homer Simpson say? D'oh! :wink:

Of course you are absolutely right. I confused the codes because my browser didn't jump to the specific post I linked to, but rather some posts below or so - maybe it's a phpBB issue.
Anyway, as you say the code before is the correct on: http://www.purebasic.fr/english/viewtop ... 60#p381060
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PB IDE Smart Highlight (showing selected text) implement

Post by skywalk »

Thanks Danilo!
Really helpful stuff to build additional IDE tools. :D
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Blue
Addict
Addict
Posts: 964
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: PB IDE Smart Highlight (showing selected text) implement

Post by Blue »

I'm late to the party, i know, but i just discovered this great hiliting tool by Danilo.
And i really wanted to say thank you Danilo for a very useful addendum to the PB arsenal.
My psychiatrist also wanted to thank him...
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: PB IDE Smart Highlight (showing selected text) implement

Post by Demivec »

Blue wrote:I'm late to the party, i know, but i just discovered this great hiliting tool by Danilo.
And i really wanted to say thank you Danilo for a very useful addendum to the PB arsenal.
My psychiatrist also wanted to thank him...
@Blue: Danilo's tool was useful. This type of highlighting is currently part of the PureBasic IDE. The IDE just requires to to select the text and then highlights it everywhere in the source, no key-presses necessary.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PB IDE Smart Highlight (showing selected text) implement

Post by skywalk »

Danilo's highlight is persistent. The IDE unhighlights once you move the cursor. Room for both modes but I prefer persistent since my code doesn't always fit on 1 screen.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Blue
Addict
Addict
Posts: 964
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: PB IDE Smart Highlight (showing selected text) implement

Post by Blue »

@Demivec : As Skywalk pointed out, the difference between the built-in hiliting and Danilo's method is important.
I don't find the built-in method at all useful, since it only provides a fleeting glance at the occurences of whatever you hilite.
With Danilo's way, you can visually follow your tracks across your code screens.

Try it, and you'll be hooked.
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: PB IDE Smart Highlight (showing selected text) implement

Post by #NULL »

great tool, thank you!

compared to the built-in IDE feature, this one also works inside strings, with parts of words / any selection, and most importantly it doesn't get confused by *asterisks and @-signs etc.
BarryG
Addict
Addict
Posts: 4127
Joined: Thu Apr 18, 2019 8:17 am

Re: PB IDE Smart Highlight (showing selected text) implement

Post by BarryG »

Danilo wrote: Sat May 19, 2012 3:37 pmreplace the PureBasic\Compilers\Scintilla.dll with a Scintilla.dll from the file above
Just discovered I don't need to replace Scintilla.dll for your tool to work; so PureBasic must now have a version that supports it.
Post Reply