Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'fix-wrong-runtimepath-setup'

* fix-wrong-runtimepath-setup:
  Remove output adjustment for the current directory
  Add a test for use of relative paths
  Remove user's after directory from &runtimepath
  Use the current vim-vspec to test itself
  • Loading branch information...
commit 63f243f458d1c3c14346ac8d64be43cfadf9e47d 2 parents eddf5ac + 64ec65f
@kana authored
Showing with 27 additions and 2 deletions.
  1. +2 −0  Makefile
  2. +2 −2 bin/vspec
  3. +23 −0 t/runtimepath.vim
View
2  Makefile
@@ -4,6 +4,8 @@ REPOS_TYPE := vim-script
INSTALLATION_DIR := $(HOME)/.vim
TARGETS_STATIC = $(filter-out t/%,$(filter %.vim %.txt,$(all_files_in_repos)))
TARGETS_ARCHIVED = $(all_files_in_repos) mduem/Makefile
+DEP_vim_vspec_URI := $(PWD)
+DEP_vim_vspec_VERSION := HEAD
View
4 bin/vspec
@@ -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)
@@ -54,7 +54,7 @@ cat <<END >"$driver_script"
call s:main()
END
-vim -u NONE -i NONE -N -e -s -S "$driver_script" 2>&1 | sed "s|$(pwd)|.|g"
+vim -u NONE -i NONE -N -e -s -S "$driver_script" 2>&1
View
23 t/runtimepath.vim
@@ -0,0 +1,23 @@
+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
+
+ it 'should not use relative paths for &runtimepath'
+ let p = '\v(^|\,)\.(\/|\\|\,|$)'
+ Expect &runtimepath !~# p
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.