PureBasic Editor improvement

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

PureBasic Editor improvement

Post by Droopy »

Comments in the PureBasic editor is less readable than JaPBe
JaPBe use this tags :

Code: Select all

; standard comment
;/ the background of this line is green
;- The background of this line is grey
Commented out an area (CTRL+B) : JaPBe vs PureBasic editor

Code: Select all

; >>>>>>>>>>>>>>>>>>>>>> PureBasic editor

; If OpenWindow(0, 0, 0, 220, 150, "ClearGadgetItems", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
;   ListViewGadget(0,10,10,200,100)
;   For a = 1 To 10 : AddGadgetItem (0, -1, "Item "+Str(a)) : Next    ; add 10 items
;   ButtonGadget(1, 10, 120, 150, 20, "Clear Listview contents")
;   Repeat
;     Event = WaitWindowEvent()
;     If Event = #PB_Event_Gadget
;       If EventGadget() = 1
;         ClearGadgetItems(0)
;       EndIf
;     EndIf
;   Until Event = #PB_Event_CloseWindow
; EndIf


; >>>>>>>>>>>>>>>>>>>>>> JaPBe

; If OpenWindow(0, 0, 0, 220, 150, "ClearGadgetItems", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ; ListViewGadget(0,10,10,200,100)
  ; For a = 1 To 10 : AddGadgetItem (0, -1, "Item "+Str(a)) : Next    ; add 10 items
  ; ButtonGadget(1, 10, 120, 150, 20, "Clear Listview contents")
  ; Repeat
    ; Event = WaitWindowEvent()
    ; If Event = #PB_Event_Gadget
      ; If EventGadget() = 1
        ; ClearGadgetItems(0)
      ; EndIf
    ; EndIf
  ; Until Event = #PB_Event_CloseWindow
; EndIf
I prefer the method of jaPBe because it's easier to uncomment the lines (when reading source).

Could this features be added to the editor ?
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: PureBasic Editor improvement

Post by Tenaja »

Droopy wrote:I prefer the method of jaPBe because it's easier to uncomment the lines (when reading source).

Could this features be added to the editor ?
I like the first idea, but this one would have to be optional--I find the "first character comment" much easier in every way. It is one of the things that is most annoying about Japbe! The first-character style is much cleaner looking, does not mess with indentation, many lines can easily be uncommented (using delete and down-arrow OR the uncomment shift-ctrl-b)...
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureBasic Editor improvement

Post by IdeasVacuum »

I agree with Tenaja - with the comment char in the left column, the code is also compatible with UltraEdit. Also, it distinguishes between a few lines of code commented out in sequence and a line that is in fact a comment.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: PureBasic Editor improvement

Post by davido »

I, too, prefer it at it is.
DE AA EB
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: PureBasic Editor improvement

Post by ozzie »

Droopy wrote:Comments in the PureBasic editor is less readable than JaPBe
JaPBe use this tags :

Code: Select all

; standard comment
;/ the background of this line is green
;- The background of this line is grey
I use jaPBe and the above is one reason that I do. I have a line containing nothing but ;- before each Procedure and Macro so I get a grey line between all my Procedure etc. I find this makes it easy to see where Procedures start and end. I use ;/ for 'important' comments as the green background makes them stand out from other comments.

So +1 for this feature to be added to the PB editor.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: PureBasic Editor improvement

Post by Danilo »

ozzie wrote:
Droopy wrote:Comments in the PureBasic editor is less readable than JaPBe
JaPBe use this tags :

Code: Select all

; standard comment
;/ the background of this line is green
;- The background of this line is grey
I use jaPBe and the above is one reason that I do. I have a line containing nothing but ;- before each Procedure and Macro so I get a grey line between all my Procedure etc. I find this makes it easy to see where Procedures start and end. I use ;/ for 'important' comments as the green background makes them stand out from other comments.

So +1 for this feature to be added to the PB editor.
If this gets added to the IDE, i would like it to be more general. If we could configure it (add new characters/words and specify colors), it could be useful.
For example:

Code: Select all

;TODO - this line has background color 2 (green)
;BUG  - this line has background color 3 (dark red)
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: PureBasic Editor improvement

Post by Tenaja »

Danilo wrote: If this gets added to the IDE, i would like it to be more general. If we could configure it (add new characters/words and specify colors), it could be useful.
For example:

Code: Select all

;TODO - this line has background color 2 (green)
;BUG  - this line has background color 3 (dark red)
+1 to this!
I have a line containing nothing but ;- before each Procedure and Macro so I get a grey line between all my Procedure etc. I find this makes it easy to see where Procedures start and end. I use ;/ for 'important' comments as the green background makes them stand out from other comments.
You could just change the background color of your procedures...
User avatar
Le Soldat Inconnu
Enthusiast
Enthusiast
Posts: 306
Joined: Wed Jul 09, 2003 11:33 am
Location: France

Re: PureBasic Editor improvement

Post by Le Soldat Inconnu »

I agree with Droopy, can be great.

Another point in PB IDE, ";{-" is not supported like ";-"
LSI
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: PureBasic Editor improvement

Post by Thunder93 »

When I disable / comment lines out on the IDE screen via right-click Edit Menu, it places the semicolon at the very first of that line. When 'Enter'ing to move to the next line it breaks my existing indentation system and puts me to the very beginning on the next line. It doesn't really bother me how they do it, but when entering from the commented line to a new line, it should preserve my existing indentation system.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: PureBasic Editor improvement

Post by Danilo »

Thunder93 wrote:When I disable / comment lines out on the IDE screen via right-click Edit Menu, it places the semicolon at the very first of that line. When 'Enter'ing to move to the next line it breaks my existing indentation system and puts me to the very beginning on the next line. It doesn't really bother me how they do it, but when entering from the commented line to a new line, it should preserve my existing indentation system.
When I write a comment and press <RETURN>, I expect the cursor to have the same indention as the first visible character
on the (commented) line before. If not, you simply press <TAB> or <BACKSPACE> until you arrive at the location you want. I do that sometimes, it is no problem.
It is how it usually works, because in some way it makes sense to continue on same indention as last line, except for special block starts like 'Select', 'If', etc.,
that start a new indention block.
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: PureBasic Editor improvement

Post by Thunder93 »

Alright, I started up a new source instead of working with existing sources. I'm experiencing something different which makes me assume that my existing sources needs to be completely formatted via right-click Edit Menu with the new IDE.


Anyways now I'm with another dislike / annoyance.

For instance using the following example;

Code: Select all

If 1 = k
  If 1 = i
    If 1 = ONE$
      If 2 = TWO$
        CommentMe.s = "This Line To be commented out."
      EndIf
    EndIf
  EndIf
EndIf

When I commented out the line containing CommentMe.s then enter from that line to the next line. It indents the line properly and moving the semicolon, the spaces and what follows .. over to the proper positioning. However when I remove the comment via right-click Edit Menu. It removes the semicolon but doesn't restore the original line positioning as it originally was before commenting it out.

Commented it out;

Code: Select all

If 1 = k
  If 1 = i
    If 1 = ONE$
      If 2 = TWO$
;         CommentMe.s = "This Line To be commented out."
      EndIf
    EndIf
  EndIf
EndIf
Entering off that commented line;

Code: Select all

If 1 = k
  If 1 = i
    If 1 = ONE$
      If 2 = TWO$
        ;         CommentMe.s = "This Line To be commented out."
        
      EndIf
    EndIf
  EndIf
EndIf
Removing the comment;

Code: Select all

If 1 = k
  If 1 = i
    If 1 = ONE$
      If 2 = TWO$
                CommentMe.s = "This Line To be commented out."
        
      EndIf
    EndIf
  EndIf
EndIf
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Le Soldat Inconnu
Enthusiast
Enthusiast
Posts: 306
Joined: Wed Jul 09, 2003 11:33 am
Location: France

Re: PureBasic Editor improvement

Post by Le Soldat Inconnu »

@Thunder93 : Your remarks is in another subject
http://www.purebasic.fr/english/viewtop ... =3&t=56677
LSI
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: PureBasic Editor improvement

Post by freak »

I would like to keep the block comments at the beginning of the line if possible. However, if somebody has a good idea how to better handle comments and the auto-indent, please post here: http://www.purebasic.fr/english/viewtop ... 46#p431046
quidquid Latine dictum sit altum videtur
Phantomas
User
User
Posts: 96
Joined: Wed Jul 01, 2009 12:59 pm

Re: PureBasic Editor improvement

Post by Phantomas »

Please, add CTRL + SHIFT + ARROW_UP/ARROW_DOWN shortcut for move lines like in Notepad++:
Image

Also:
CTRL + 0-9 NUMBER for select desired TAB like in FireFox:
Image
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PureBasic Editor improvement

Post by PB »

> so I get a grey line between all my Procedure etc.
> I find this makes it easy to see where Procedures
> start and end

There's a setting in the PB IDE that automatically
colors procedure backgrounds different to the rest
of the source code.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Post Reply