Permalink
Browse files

avoid overwriting 'path'; restore it after use

  • Loading branch information...
1 parent 23483b7 commit f569e6f6faba4a7aa0010a99a4d0f5177d3bb4c9 Samuel Ferencik committed May 24, 2011
Showing with 13 additions and 2 deletions.
  1. +13 −2 ftplugin/perl.vim
View
@@ -60,11 +60,22 @@ if !exists("perlpath")
endif
endif
-let &l:path=perlpath
+" Append perlpath to the existing path value, if it is set. Since we don't
+" use += to do it because of the commas in perlpath, we have to handle the
+" global / local settings, too.
+if &l:path == ""
+ if &g:path == ""
+ let &l:path=perlpath
+ else
+ let &l:path=&g:path.",".perlpath
+ endif
+else
+ let &l:path=&l:path.",".perlpath
+endif
"---------------------------------------------
" Undo the stuff we changed.
-let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp<" .
+let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" .
\ " | unlet! b:browsefilter"
" Restore the saved compatibility options.

0 comments on commit f569e6f

Please sign in to comment.