From 72da8f8fce9b60ad456fee951522a4602d2c4e88 Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Wed, 18 Nov 2015 01:50:44 -0800 Subject: [PATCH] Trim trailing whitespace at logging time --- autoload/vundle/installer.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 472271a..2ad085a 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -527,8 +527,11 @@ func! s:log(str, ...) abort let fmt = '%Y-%m-%d %H:%M:%S' let lines = split(a:str, '\n', 1) let time = strftime(fmt) + let entry_prefix = '['. time .'] '. prefix for line in lines - call add(g:vundle#log, '['. time .'] '. prefix . line) + " Trim trailing whitespace + let entry = substitute(entry_prefix . line, '\m\s\+$', '', '') + call add(g:vundle#log, entry) endfor return a:str endf