Trailing blanks are being deleted for variables

Document ID : KB000089174
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Trailing blanks are being deleted for variables
Resolution:
Detailed Description and Symptoms

When using variables to safe or pass values, trailing blanks are being deleted. Leading blanks will be saved/passed. Using trailing blanks was possible in version 6.

example:

:set &a# = 'test ' will be saved/passed with the value 'test'
:set &a# = ' test' will be saved/passed with the value ' test'

Solution
As a workaround you can save/pass the value with a character (not blank) at the end after the trailing blanks and you can truncate this character when reading the value