From bc108a798eef89cbfe3c0daaa1729f77a0c18b3e Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Tue, 14 Jun 2011 16:49:14 +0200 Subject: Bug fix: Trim leading/trailing empty lines --- str.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'str.vim') diff --git a/str.vim b/str.vim index 19bfe09..74a05aa 100644 --- a/str.vim +++ b/str.vim @@ -1,12 +1,12 @@ " Vim auto-load script " Author: Peter Odding -" Last Change: March 15, 2011 +" Last Change: June 14, 2011 " URL: http://peterodding.com/code/vim/misc/ " Trim whitespace from start and end of string. function! xolox#misc#str#trim(s) - return substitute(a:s, '^\s*\(.\{-}\)\s*$', '\1', '') + return substitute(a:s, '^\_s*\(.\{-}\)\_s*$', '\1', '') endfunction " vim: ts=2 sw=2 et -- cgit v1.2.3