Permalink
Browse files

Remove user's after directory from &runtimepath

  • Loading branch information...
1 parent d696b58 commit 68c6e033eadee4b3f255e3f6e30824eab882df4b @kana committed Feb 12, 2012
Showing with 19 additions and 1 deletion.
  1. +1 −1 bin/vspec
  2. +18 −0 t/runtimepath.vim
View
@@ -39,7 +39,7 @@ unset args[$((${#args[@]}- 1))] # Now holds all {non-standard-runtimepath}s.
cat <<END >"$driver_script"
function s:main()
- let standard_paths = split(&runtimepath, ',')[1:-1]
+ let standard_paths = split(&runtimepath, ',')[1:-2]
let non_standard_paths = reverse(['$(echo "${args[@]}" |
sed "s/ */', '/g")'])
let all_paths = copy(standard_paths)
View
@@ -0,0 +1,18 @@
+describe 'bin/vspec'
+ it 'should remove user''s directory from the default &runtimepath'
+ let current_runtimepath = &runtimepath
+ set runtimepath&
+ let default_runtimepath = &runtimepath
+ let &runtimepath = current_runtimepath
+
+ let cs = split(current_runtimepath, ',')
+ let ds = split(default_runtimepath, ',')
+ let n = (len(cs) - (len(ds) - 2)) / 2
+
+ for i in range(len(ds) - 2)
+ Expect cs[n + i] ==# ds[1 + i]
+ endfor
+ Expect stridx(ds[0], $HOME) != -1
+ Expect stridx(ds[-1], $HOME) != -1
+ end
+end

0 comments on commit 68c6e03

Please sign in to comment.