jbushmaster007 / anyedittools

Automatically exported from code.google.com/p/anyedittools
Other
1 stars 0 forks source link

Add an option to disable trailing whitespace removal for empty lines #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Add an option similar to JDT's one: disable trailing whitespace removal for
empty lines.

Empty lines are widely used in virtually any source files to visually
delimit logical blocks: markup blocks in xml/html/jsp or methods/groups of
statements in java files, etc.

If trailing whitespace will be removed on these lines, cursor will "jump"
to the left while navigating the code with up/down arrows. If these lines
are long enough - this jumping will cause editor area to "jump" to the left
and back to the code/markup. Just try to move up and down in the file
consisting of mixed 300 chars long and empty lines and you will see what
I'm trying to describe :)

Attached patch includes proposed feature implementation. Though it looks
like it works as expected, I won't put too much promise into it. 

P.S. This patch includes one other relatively small change. I don't think
it worth creating separate request for this one.
I think "Remove trailing whitespace on save" should be disabled by default.
The main reason is that results of this operation remains unseen by junior
developers for a long time.
Consider project developed by a team. Junior developer just installed
eclipse with plugins his colleagues consider to be useful. Anyedittools is
one of them.
This developer makes small change (for example, removes single
System.out.println) and commits changes without reviewing them (a single
simple change after all). But instead, he commits 200+ changes (about 40%
of code lines are affected by trailing whitespace removal in several of our
projects) and it becomes quite hard to track down what actually changed in
said revision.

Though this feature is very useful, it could be quite troublesome for
unaware developers. And to make them aware, this feature should be enabled
by them in the first place :) 

Original issue reported on code.google.com by allat...@gmail.com on 20 Aug 2009 at 12:25

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for the patch!

I will look later on it.

For the second part: I will definitely NOT disable the option to strip 
whitespace on 
save by default.

The reason is simple: in your example, not the junior developer has a problem, 
it's 
the senior developers duty to make sure that the codebase is in the good state. 
If 
it is not, then nobody should blame juniors.

I insist on a project/organisation wide code conventions, IF there is more then 
one 
man working on a code, it's simply a "must have". The simple solution would be 
made 
an initial cleanup WITHOUT changing the code logic before starting to work on a 
project.

If you still not agree, you can simply enable your own defaults by customizing 
Eclipse produkt .options in your organization and set whatever option you think 
is 
right for AnyEdit.

Regards,
Andrei

Original comment by iloveeclipse on 20 Aug 2009 at 5:13

GoogleCodeExporter commented 8 years ago
This issue is a duplicate that came up during migration to Eclipse Labs - 
sorry for the trouble!

Original comment by nathaniel@google.com on 13 May 2010 at 11:09