You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command :%s/\s+$// is a common one for removing trailing whitespace from lines. Without the % range, :s/\s+$// works correctly on a single line, but with the % range (or 1,$) the expression incorrectly removes blank lines.
For example, running the command against the following (Github is removing whitespace :-/, hence the \ss instead of real spaces)
I know this is a VIM-derived project but since it's a plugin for Xcode, have you considered setting your Xcode Editor options to remove trailing whitespace automatically?
@structAnkit, the remove trailing whitespace feature of Xcode doesn't always work correctly, but even if it did, :%s/\s+$// still doesn't work as Vim does. Though @pebble8888's comment seems to explain why, and using :%s/[ \t]+$// did work for me.
The command
:%s/\s+$//
is a common one for removing trailing whitespace from lines. Without the%
range,:s/\s+$//
works correctly on a single line, but with the%
range (or1,$
) the expression incorrectly removes blank lines.For example, running the command against the following (Github is removing whitespace :-/, hence the
\s
s instead of real spaces)should result in
but instead results in
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: