I recently updated to the latest version from github and noticed on master and develop that whitespace removal is very slow. On files over 1,000 lines, it was taking 10+ seconds to save on my box.
The following patch fixes the performance problem for me, and it seems to work with my very minimal testing.
diff --git a/ftplugin/python/pymode.vim b/ftplugin/python/pymode.vim
index 713bafe..4df9847 100644
--- a/ftplugin/python/pymode.vim
+++ b/ftplugin/python/pymode.vim
@@ -133,7 +133,7 @@ endif
" Utils {{{
if pymode#Option('utils_whitespaces')
- au BufWritePre <buffer> :call setline(1,map(getline(1,"$"),'substitute(v:val,"\\s\\+$","","")'))
+ au BufWritePre <buffer> :%s/\s\+$//e
endif
" }}}
I recently updated to the latest version from github and noticed on master and develop that whitespace removal is very slow. On files over 1,000 lines, it was taking 10+ seconds to save on my box.
The following patch fixes the performance problem for me, and it seems to work with my very minimal testing.