It is currently Thu Nov 21, 2019 7:12 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Format indentation should remove blank space on end of lines
PostPosted: Sat May 14, 2016 1:18 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 25, 2014 5:25 pm
Posts: 373
Location: Germany
It would be nice to see that the menu command "Edit => Format indentation" would also remove spaces at the end of each line of code.

_________________
Image
Why OpenSource should have a license
PureBasic-CodeArchiv-Rebirth: Git-Repository / Download -- Any help is welcome!
Manjaro Xfce x64 (Main system) :: WindowsXP/Xubuntu x86 (VirtualBox) :: PureBasic (Linux: x86/x64, Windows: x86) :: All are up to date


Top
 Profile  
Reply with quote  
 Post subject: Re: Format indentation should remove blank space on end of l
PostPosted: Sun May 15, 2016 3:44 am 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1033
Location: Portugal
+1

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: Format indentation should remove blank space on end of l
PostPosted: Sun May 15, 2016 7:00 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu May 11, 2006 1:04 am
Posts: 391
Location: New Jersey, USA
I've found that quirk to be quite annoying ... I agree. Although in my opinion it ranks
low on the list , below actual bug fixes.

_________________
Pi is a new digital currency being developed by a group of Stanford PhDs.
You can join the beta to earn Pi and help grow the network.
Use FTI2019 as your invitation code.


Top
 Profile  
Reply with quote  
 Post subject: Re: Format indentation should remove blank space on end of l
PostPosted: Sun May 15, 2016 6:40 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 1135
Location: right here
if you consider macros then spaces at the end of a line might not always be outside of a string (note the spaces in a()):
Code:
Macro a()
  "x         
EndMacro
Macro b()
  x"
EndMacro
s.s = a() b()
Debug s


spaces at the beginning of the macro body are already ignored as indentation though (don't know right now if only for the first line).


Top
 Profile  
Reply with quote  
 Post subject: Re: Format indentation should remove blank space on end of l
PostPosted: Mon May 16, 2016 8:14 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1899
I agree with the above: this would break macros that rely on spaces. So, I vote no.


Top
 Profile  
Reply with quote  
 Post subject: Re: Format indentation should remove blank space on end of l
PostPosted: Mon May 16, 2016 8:21 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 04, 2015 7:10 am
Posts: 1673
maybe just don't apply the fix to lines within macros?
i like the suggestion - i dont know why but the PB IDE seems to add a lot of extra spaces after some lines for no reason (somewhat intermittently), which frustrates me a lot when im trying to quickly navigate to the end of a line (often) and have to waste time clicking over useless spaces i never added in the first place

_________________
Thankyou to all the coders who generously helped & encouraged me in the nearly 2yrs when i was welcome here,
it was a tremendous privilege. I learned a lot. I wish you and your families all the best and success for the future.


Top
 Profile  
Reply with quote  
 Post subject: Re: Format indentation should remove blank space on end of l
PostPosted: Mon May 16, 2016 8:26 am 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5857
Location: Wales, UK
Instead of "Edit => Format indentation" additionally removing spaces at the end of lines, let's have a separate command for that task.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Format indentation should remove blank space on end of l
PostPosted: Sat Aug 31, 2019 10:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 25, 2014 5:25 pm
Posts: 373
Location: Germany
@#Null:
Is such code often in use?
There are certainly many programmers here who also use other text editors besides the PB-IDE. Some of them have possibly defaulted settings that remove trailing spaces.

IdeasVacuum wrote:
Instead of "Edit => Format indentation" additionally removing spaces at the end of lines, let's have a separate command for that task.
That's okay for me, too.
Or replace the menu item with "Reformat code". You can then specify in the preferences what the menu item should do (adjust indentation, remove trailing spaces, etc.).

_________________
Image
Why OpenSource should have a license
PureBasic-CodeArchiv-Rebirth: Git-Repository / Download -- Any help is welcome!
Manjaro Xfce x64 (Main system) :: WindowsXP/Xubuntu x86 (VirtualBox) :: PureBasic (Linux: x86/x64, Windows: x86) :: All are up to date


Top
 Profile  
Reply with quote  
 Post subject: Re: Format indentation should remove blank space on end of l
PostPosted: Sun Sep 01, 2019 6:45 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 1135
Location: right here
Sicro wrote:
@#Null:
Is such code often in use?
I don't think so, I've never seen or used it. But that the behavior of the program might change by such a modification is something that should be considered. It can also be avoided by using
Code:
Macro a()
  "x         "+"
EndMacro


Top
 Profile  
Reply with quote  
 Post subject: Re: Format indentation should remove blank space on end of l
PostPosted: Sun Sep 08, 2019 4:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 25, 2014 5:25 pm
Posts: 373
Location: Germany
#NULL wrote:
But that the behavior of the program might change by such a modification is something that should be considered.
Yes, that's why I think the suggestion of @Keya to leave the trailing spaces/tabs within macro blocks untouched is a good compromise.

_________________
Image
Why OpenSource should have a license
PureBasic-CodeArchiv-Rebirth: Git-Repository / Download -- Any help is welcome!
Manjaro Xfce x64 (Main system) :: WindowsXP/Xubuntu x86 (VirtualBox) :: PureBasic (Linux: x86/x64, Windows: x86) :: All are up to date


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye