PB IDE plugin:autocomplete string & comment, code beautifier

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

PB IDE plugin:autocomplete string & comment, code beautifier

Post by eddy »

:arrow: download link: StringPlugin.zip

Tool features:
  • supported version: PB IDE 5.30+ x86 or x64
  • autocomplete comment
  • autocomplete split strings
  • autocomplete multiline strings
  • autoscrolling margins
  • auto format code
  • shortcut to insert newline constant (#LF$,#CR$,#CRLF$)
  • ticker caret
  • current line always visible
  • word highlighting cosmetic settings
  • indent on paste
  • trim trailing spaces
  • new environment variables for compiler options
How to configure tool:
1- unzip the downloaded file
2- open IDE menu: Tools > Configure Tools...
3- click on "New" button
4- enter the below settings then click on "OK" button
  • If you use an x64 PB IDE:
    • CommandLine: [plugin path]\PBPlugins.exe
    • Name: PB Plugins
    • Event to trigger: Editor Startup
    Or if you use an x86 PB IDE:
    • CommandLine: [plugin path]\x86\PBPlugins.exe
    • Name: PB Plugins
    • Event to trigger: Editor Startup
How to exit:
  • click on systray red icon "[S]"
Image
Last edited by eddy on Sat Dec 06, 2014 6:40 pm, edited 34 times in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Olby
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Jan 12, 2009 10:33 am
Contact:

Re: PB IDE plugin: string auto split

Post by Olby »

Looks really useful, I could use one myself. Thanks.
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PB IDE plugin: string auto split

Post by PB »

Doesn't seem to work here. If I hit Return in the middle of a string,
it just puts the rest of the string on the next line, with no + on the
line prior. It doesn't do what your example code shows.

Also, it doesn't quit when the IDE quits, so each time I launch
PureBasic I get a bunch of red [S] icons in the System Tray. :(
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PB IDE plugin: string auto split

Post by eddy »

PB wrote:Doesn't seem to work here. If I hit Return in the middle of a string,
it just puts the rest of the string on the next line, with no + on the
line prior. It doesn't do what your example code shows.
It didn't detect the string scintilla style. Which PB version do you use ?
PB wrote: Also, it doesn't quit when the IDE quits, so each time I launch
PureBasic I get a bunch of red [S] icons in the System Tray.
Oops! I'll fix that. :shock:
Last edited by eddy on Wed Aug 20, 2014 6:51 am, edited 1 time in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PB IDE plugin: string auto split

Post by PB »

> Which PB version do you use ?

See my sig. ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PB IDE plugin: string auto split

Post by eddy »

[Updated]
- fixup: launch only one instance at IDE start
- fixup: autoclose tool when the IDE quits
- added: autocomplete comment
- added: autocomplete multiline string
- added: autoscrolling margins
- added: word highlighting customizations

I hope your bugs are fixed with this version.

Image

Image
Image

TODO:
- save/restore settings
- code beautifier
- Auto indent on paste
Last edited by eddy on Sun Sep 14, 2014 1:39 pm, edited 4 times in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PB IDE plugin: autocomplete strings & comments

Post by eddy »

[Updated]
- save/restore preferences
- indent on paste
- new environment variables (they can be used to define custom constants in compiler options)

Image
Last edited by eddy on Sun Sep 14, 2014 12:41 pm, edited 1 time in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 283
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: PB IDE plugin:autocomplete string & comment, code beauti

Post by oreopa »

Hi eddy. Thanks for this tool, I used to love your old one, before most of it got added to the IDE natively...

There are big problems here tho with this here... literally nothing works. Sorry to report that :D To add insult to injury, the tool doesnt auto-quit when I quit PB, and if I try to close it manually via the tray icon it throws the generic "PBPlugins.exe has stopped working" windows error.

Im using Win 7 Home Premium x64 + PB 5.30 x86.

Copy of log, if its any help:

Code: Select all

130544.Plugin.ProcessId = 9860
130544.Plugin.Tool = 656428
130544.Plugin.UpdateDate = 65868388
130544.Settings.CodeBeautifier.AutoindentPaste.Value = 1
130544.Settings.CodeBeautifier.FixSpacings.Value = 1
130544.Settings.CodeBeautifier.TrimSpaces.Value = 1
130544.Settings.CommentHelpers.AutocompCommentBars.Value = 1
130544.Settings.CommentHelpers.AutocompCommentBlock.Value = 1
130544.Settings.CommentHelpers.MinCommentBarLength.Value = 10
130544.Settings.CompilingHelpers.CustomEnvVars.Value = 1
130544.Settings.StringHelpers.AutocompMultilineStrings.Value = 1
130544.Settings.StringHelpers.AutocompSplitStrings.Value = 1
130544.Settings.VisualHelpers.AutoScrollMarginSize.Value = 5
130544.Settings.VisualHelpers.AutoScrollMargins.Value = 1
130544.Settings.VisualHelpers.CurrentLineAlwaysVisible.Value = 1
130544.Settings.VisualHelpers.CustomHighlighting.Value = 1
130544.Settings.VisualHelpers.HighlightBorderOpacity.Value = 200
130544.Settings.VisualHelpers.HighlightOpacity.Value = 100
130544.Settings.VisualHelpers.HighlightStyle.Value = 0
130544.Settings.VisualHelpers.TickerCaret.Value = 1
PB_Focus = 656428
PB_GadgetStack_4194304 = 35938040
PB_WindowID = 3
pb_menu_callback = -63667
pb_officemenu_callback = -62919
pb_statusbar_callback = 5689404
pb_statusbar_id = 1
pb_toolbar_callback = 5530990
pb_toolbar_id = 0
Lemme know if you need more infos. Thanx.
Proud supporter of PB! * Musician * C64/6502 Freak
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PB IDE plugin:autocomplete string & comment, code beauti

Post by eddy »

oreopa wrote:Hi eddy. Thanks for this tool, I used to love your old one, before most of it got added to the IDE natively...

There are big problems here tho with this here... literally nothing works. Sorry to report that :D To add insult to injury, the tool doesnt auto-quit when I quit PB, and if I try to close it manually via the tray icon it throws the generic "PBPlugins.exe has stopped working" windows error.

Im using Win 7 Home Premium x64 + PB 5.30 x86.

Copy of log, if its any help:
Lemme know if you need more infos. Thanx.
I reproduced your bug with x86 version of IDE
I'll compile an x86 version
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PB IDE plugin:autocomplete string & comment, code beauti

Post by eddy »

[Updated]
- Added: x86 plugin version for x86 PB IDE
- I added an x86 paragraph in "How to configure" section. (see above)

TODO:
- word highlighting adaptive colors
- Trim spaces
- Fix spacings
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 283
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: PB IDE plugin:autocomplete string & comment, code beauti

Post by oreopa »

Can happily inform you that the new x86 version works perfectly. Quits gracefully on PB exit and everything appears to work. Thanks for the quick fixing. Useful tool, appreciate it!
Proud supporter of PB! * Musician * C64/6502 Freak
deesko
User
User
Posts: 39
Joined: Fri Sep 21, 2012 11:40 pm
Location: Portugal

Re: PB IDE plugin:autocomplete string & comment, code beauti

Post by deesko »

I'm sorry to report, but Avast claims the "x86\PBPlugins.exe" plugin has the "Win32:Evo-gen [Susp]", while the x64 seems fine. Were both programs created with PureBasic?

Nervertheless, thank you for your contribution.
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

Re: PB IDE plugin:autocomplete string & comment, code beauti

Post by Bisonte »

deesko wrote:I'm sorry to report, but Avast claims the "x86\PBPlugins.exe" plugin has the "Win32:Evo-gen [Susp]", while the x64 seems fine. Were both programs created with PureBasic?
Yesterday I wrote a little program that find the "firefox.exe" and terminate it, and Avira claims it to Win32/Hijacker.Gen... I think it's using WinAPI like mine little program to find PureBasic.exe. So the only virus in system is the "virus-scanner" ;)
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: PB IDE plugin:autocomplete string & comment, code beauti

Post by Little John »

Bisonte wrote:[...] Avira [...]
So the only virus in system is the "virus-scanner" ;)
Avira is particularly good in "finding" anything.
Some time ago, it had actually detected itself as trojan. :mrgreen:
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PB IDE plugin:autocomplete string & comment, code beauti

Post by eddy »

[Updated]
- optimized: autocomplete multiline string
- added : beautify code (only on paste for the moment)
- added : trim trailing spaces
Image

Image
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Post Reply