Page 1 of 10

PB IDE plugin : smart indent, remove spaces, autocompletions

Posted: Sat Mar 29, 2008 7:44 pm
by eddy
:arrow: v3.9beta - Download >> PureBasic Editor Extension
old version v3.8 - Download >> PureBasic Editor Extension

:arrow: Demo Video : http://www.screencast.com/users/rineddy ... f7280bb9d8
:arrow: Demo Screenshot : http://media1.pikeo.com/images/server17 ... U7J71Z.png

Features :
- Option: backspace unindents (like DELPHI)
* obsolete *- Option: auto-indent on the fly (directly after keying RETURN or SPACE )
* obsolete *- Option: indent custom tags ;< ;> (like JAPBE)
* obsolete *- Option: indent custom keywords (ex: Class..EndClass StartShooting..StopShooting)
* obsolete *- Option: indent compiler directives (compilerIf...compilerEndif)
* obsolete *- Option: indent DataSection
* obsolete *- Option: indent Start...Stop PB commands (like Start3D Stop3D)

- Option: remove extra empty lines (directly after keying RETURN )
- Option: remove trailling spaces on the fly (directly after keying RETURN )
- Option: autocomplete comment block
- Option: autocomplete custom keywords (ex: Class..EndClass, StartShooting..StopShooting)
- Option: autocomplete compiler directives
- Option: autocomplete 'end' matching keyword (directly after keying
RETURN )
- Option: autocomplete Start...Stop PB commands
- Option: fix up the spacings (with customizable spacing rules)
- Option: format whole source at loading (with customizable formatting rules)
- Option: ticker caret
- Option: indent guide
- Option: preview folded lines
- Option: disable splashscreen
- debugger
- single instance for each opened PB editor
- save preferences
- auto-start mode
- ADDED : toolbar icon to open the configuration panel
- ADDED : toolbar icon to format whole source
- ADDED : configuration panel
- ADDED : easy installation
TODO list :
- customize tabs (popupmenu, mouse click to close)

How to install :
1- unzip this file
2- stop your PB editor (if it's running)
3- double-click on EXE file and confirm your installation.
(the installation backup your preference file)

Image

Image

Image


http://www.datafilehost.com/download-83e1e8a0.html

Posted: Sun Mar 30, 2008 8:17 pm
by eddy
[released v2.3]
- ADDED : trim trailling spaces
- OPTIMIZED : only visible lines are analyzed now

Remark : "trim trailling spaces" function does not remove empty lines.

Posted: Mon Mar 31, 2008 7:44 pm
by eddy
w.i.p
- EndKeyword : 80% ( I have to fix a coloring problem after any insertion )

Posted: Mon Mar 31, 2008 11:39 pm
by #NULL
'Next' doesn't decrease the indent here.
..[end]structure[union], [End]Select, Case, Default
ok.. i see, it wasn't meant to be finished.

i really like it and will definately use it when it's working better. thank you :)

<edit>
is there a possibility to apply it to more code than visible? ..like the selection, as an idea.
i personally would also like to have start/stopdrawing()-blocks indented (maybe possible as optional?)

<edit>
you're creating a separate *.ini for each sourcefile with a different path? wouldn't it be better to have one *.ini in the directory of the tool.exe only?

Posted: Tue Apr 01, 2008 9:12 am
by eddy
#NULL wrote:'Next' doesn't decrease the indent here.
..[end]structure[union], [End]Select, Case, Default
ok.. i see, it wasn't meant to be finished.
Could you post a screenshot of this problem (a wrong indent result) ?
<edit>
is there a possibility to apply it to more code than visible? ..like the selection, as an idea.
i personally would also like to have start/stopdrawing()-blocks indented (maybe possible as optional?)
- about customization... yes
- about selection... do you mean a option in context menu ?
<edit>
you're creating a separate *.ini for each sourcefile with a different path? wouldn't it be better to have one *.ini in the directory of the tool.exe only?
- I don't see the user case but why not...

Posted: Tue Apr 01, 2008 2:00 pm
by #NULL
you could check if there is a selection and apply it to it, or apply it just as you are doing currently if there's nothing selected (i guess it's possible to detect that).


that's what it looks like:

Code: Select all

Structure my_s
  x.l
  StructureUnion
  a.b
  c.d
  EndStructureUnion
  EndStructure
  
  
  If 1
    n=3
    Debug n
    EndIf
    
    
    
    Select n
      Case 3
        n*10
        Default
        Debug "default"
        EndSelect
        
        
        
        For i=0 To 10
          n=i
          Debug n
          Next
          
          
          
          DataSection
          Data.l 12
          Data.b 34
          EndDataSection
          

Posted: Wed Apr 02, 2008 12:06 am
by eddy
weird I can't reproduce this problem.

- Is there another external tool installed ?
- Did you make your test in UTF8 mode ?
- Did you make your test with the last PB version or older ?

I have to improve the debugger to analyse this bug

Posted: Wed Apr 02, 2008 1:00 pm
by #NULL
all other tools disabled (not many anyway). i also tried with(out) unicode (that couldn't influence your programm anyway, could it?). i tried with PB 4.10, 4.20b2 and b3. always the same result.

..i made a copy of my pb-4.10 installation, startet the ide with /portable, configured the tool there, and it works! i will look further which pb setting of mine could be causing it.

<edit>
found it: i have to "enable bolding of keywords" to get your tool working. (i always disable that, because it destroys the monospace-matrix)

<edit>
when i close the ide very quickly right after opening it, PureEditorExtension stays alive as a process (-->taskmanager). maybe that's only because of the delay from your little splash screen? (it looks very nice actually, but could become annoying if you like your ide quick)

Posted: Wed Apr 02, 2008 5:25 pm
by Michael Vogel
The smart indent function seems to work fine with 4.20ß3 (but not with 4.02) and thats much better than my own Autoindent work :wink:

When the whole code runs fine, try to find some nice descriptions for the options (e.g. "remove trailing spaces" instead of "do trailing spaces")

Michael

Posted: Wed Apr 02, 2008 8:56 pm
by eddy
#NULL wrote:found it: i have to "enable bolding of keywords" to get your tool working. (i always disable that, because it destroys the monospace-matrix)

when i close the ide very quickly right after opening it, PureEditorExtension stays alive as a process (-->taskmanager). maybe that's only because of the delay from your little splash screen? (it looks very nice actually, but could become annoying if you like your ide quick)
Ok I can fix that: keyword and splashscreen slowdown

Michael Vogel wrote:The smart indent function seems to work fine with 4.20ß3 (but not with 4.02) and thats much better than my own Autoindent work :wink:

When the whole code runs fine, try to find some nice descriptions for the options (e.g. "remove trailing spaces" instead of "do trailing spaces")

Michael
I'll externalize the resource file laster .

Posted: Thu Apr 03, 2008 11:53 pm
by eddy
[released v2.4]
- FIXED : quick-close editor while splashscreen
- FIXED : indent (for non-bold keywords)
- ADDED : I make some tests with special keywords (it works !!)
- UPDATED : PASTE support "indent" & "trim trailling spaces"
  • dataSection EndDataSection
  • start3d stop3d
  • startdrawing stopdrawing
  • startprinting stopprinting
  • startspecialfx stopspecialfx
TODO : Of course, I have to add a "custom keywords" list :lol:

indent test result

Code: Select all

ProcedureCDLL DUMMY(param.l)
	;///// STRUCTURE
	Structure TEST
		a.l
		b.s
		StructureUnion
			x.l
			xx.f
			xxx.s
		EndStructureUnion
	EndStructure
	
	;///// NEW BLOCK
	Start3D()
		If a>3
			Select a
				Case 10
				Case 20
				Case 30
				Default
					Debug "POP"
			EndSelect
		EndIf
	Stop3D()
EndProcedure

Posted: Fri Apr 04, 2008 10:33 am
by #NULL
great, thanks.

just no indent here within datasection.

<edit>
about the custom list: in jaPBe you can simply add a ;> at the end of a line to indent following lines (and ;< to close the indent again) like

Code: Select all

myStartProc() ;>
  myStuff()
myFinishProc() ;<

Posted: Fri Apr 04, 2008 1:01 pm
by eddy
good idea it's OK

Posted: Sat Apr 05, 2008 11:26 am
by #NULL
some problems with If

Code: Select all

If n
  works=#True
EndIf

If Not n
works=#False
EndIf

If (Not n)
  works=#True
EndIf


Posted: Sat Apr 05, 2008 2:25 pm
by eddy
I see...Its always the 'non-bold keyword' problem.