godlygeek/tabular — pull request #21 by jamessan (2013-01-23 19:44:35+00:00)
Title: Always strip trailing spaces in TabularizeStrings

Currently, trailing spaces are only stripped from the first element in a line if it contains non-whitespace characters, however this causes padding creep.

Given a block like

foo => bar
beezlebub
=> debil
john => doe

`:GTab /=>/` will move the `=>` column to the right by one instead of to the left by one. Similarly, using `:Tab /=>/` twice will first align the column as expected, but then shift the column one to the right every time you repeat the command.

This is because the leading whitespace on the `=> debil` line is considered when calculating the max line length.

Stripping the trailing whitespace (which is all of the whitespace in this case) ensures the lines are all aligned, only taking into account relevant content.