-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim trailing whitespace in VundleLog #671
Conversation
@nfischer would it be better if trailing spaces get trimmed when log is generated? |
Good catch. I agree, that's the better way to do it. I updated this with the new fix. Commits have been squashed. |
Just updated to move some work outside of the for loop, so performance may be slightly improved. Should be ready for review now. |
for line in lines | ||
call add(g:vundle#log, '['. time .'] '. prefix . line) | ||
" Trim trailing whitespace | ||
let entry = substitute(entry_prefix . line, '\m\s\+$', '', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be just entry_prefix.substitute(line, '\m\s\+$', '', '')
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This falls apart for the case where line
is the empty string. This would append the empty string onto the end, but wouldn't fix the trailing whitespace in entry_prefix
(since we put a space between the time stamp and the prefix
. So I believe this approach is a more robust way to go
also could you please attach a screenshot of the issue? Just for the record… |
@ryanoasis @gmarik pinging this thread, to see if this can be merged or should be closed |
@nfischer I think this should be merged. When I get time I plan on testing it (just hasn't happened yet) 😞 |
@ryanoasis Ok awesome! It's intended to be a fairly harmless change, it just makes things look nicer for people like me who highlight trailing white space. And it makes things nicer if #683 is merged. |
Trim trailing whitespace in VundleLog
Finally got around to getting these into branch/release 0.10.3 Have only cursory tested Side note, not sure when it happened (seems to even happen on master) but during my testing |
Just tried this out on the new branch, and |
Thanks for checking. I'm going to retest today I think something funky may have been happening with my connection |
Trims trailing white space in the Vundle log file with
:s/\s\+//e
and then restores cursor position and the search register's previous value. This should be relatively side-effect free.