Hi folks,
I quite often seem to find stray whitepsace at the end of my lines when I'm editing Ruby code. I'm reasonably certain that I'm not going around adding a tab here or there to the end of lines (it's not every line).
It doesn't seem to be harmful but, as a neat freak, I find it distressing. I assume that it's TxMt that's adding it because I can't think where else it can be coming from. Does anyone else see this? Does anyone know how to stop it?
Regards,
Matt
-- Matt Mower :: http://matt.blogs.it/
On Dec 4, 2005, at 13:35, Matt Mower wrote:
Hi folks,
I quite often seem to find stray whitepsace at the end of my lines when I'm editing Ruby code. I'm reasonably certain that I'm not going around adding a tab here or there to the end of lines (it's not every line).
It doesn't seem to be harmful but, as a neat freak, I find it distressing.
Agreed.
I assume that it's TxMt that's adding it because I can't think where else it can be coming from. Does anyone else see this?
Yes, what I see is that if ENTER produces an indented line, and I press ENTER again to leave a blank line, the "blank" line keeps the whitespace. Strictly speaking it makes sense.
In practice, though, blank lines that are not equal to "\n" look suspicious in general to me. Specially editing Python, where whitespace is so important:
def foo(): print "foo"
def bar(): print "bar"
If you hitted the backspace in the second def line, the blank line is not blank. It does not introduce an error, but the fact is that I find it counter-intuitive. And that applies to non-Python as well for me.
Does anyone know how to stop it?
Since the behaviour is correct, because if I put there an indent the editor cannot assume I didn't actually want it, maybe I would like to have that standard feature which is to be able to configure the editor to strip trailing whitespace on saving.
-- fxn
On 04/12/05, Xavier Noria fxn@hashref.com wrote:
On Dec 4, 2005, at 13:35, Matt Mower wrote: Since the behaviour is correct, because if I put there an indent the editor cannot assume I didn't actually want it, maybe I would like to have that standard feature which is to be able to configure the editor to strip trailing whitespace on saving.
Either that or a specific "strip trailing whitespace" command would work for me.
M
-- Matt Mower :: http://matt.blogs.it/
Matt Mower wrote:
Either that or a specific "strip trailing whitespace" command would work for me.
There's a command in the Text bundle that does that.
For extra convenience, record a macro that calls the command and saves the current file, save that macro and bind it to a key and you have a "delete trailing whitespace and save"-shortcut :)
Jeroen.