diff --git a/.SpaceVim.d/autoload/SpaceVim/dev/api.vim b/.SpaceVim.d/autoload/SpaceVim/dev/api.vim index 20b6b554d..933a2cb40 100644 --- a/.SpaceVim.d/autoload/SpaceVim/dev/api.vim +++ b/.SpaceVim.d/autoload/SpaceVim/dev/api.vim @@ -10,6 +10,7 @@ scriptencoding utf-8 let s:FILE = SpaceVim#api#import('file') let s:SYS = SpaceVim#api#import('system') +let s:CMP = SpaceVim#api#import('vim#compatible') let s:AUTODOC = SpaceVim#api#import('dev#autodoc') @@ -45,7 +46,7 @@ function! s:generate_content() abort endfunction function! s:api_list() abort - let layers = SpaceVim#util#globpath('~/.SpaceVim/', 'docs/api/**/*.md') + let layers = s:CMP.globpath('~/.SpaceVim/', 'docs/api/**/*.md') let list = [ \ '| Name | Description |', \ '| ---------- | ------------ |' @@ -70,7 +71,7 @@ function! s:api_list() abort endfunction function! s:api_list_cn() abort - let layers = SpaceVim#util#globpath('~/.SpaceVim/', 'docs/cn/api/**/*.md') + let layers = s:CMP.globpath('~/.SpaceVim/', 'docs/cn/api/**/*.md') let list = [ \ '| 名称 | 描述 |', \ '| ---------- | ------------ |' diff --git a/.SpaceVim.d/autoload/SpaceVim/dev/layers.vim b/.SpaceVim.d/autoload/SpaceVim/dev/layers.vim index d9db4fce2..dd02bba81 100644 --- a/.SpaceVim.d/autoload/SpaceVim/dev/layers.vim +++ b/.SpaceVim.d/autoload/SpaceVim/dev/layers.vim @@ -10,6 +10,7 @@ scriptencoding utf-8 let s:FILE = SpaceVim#api#import('file') let s:SYS = SpaceVim#api#import('system') +let s:CMP = SpaceVim#api#import('vim#compatible') @@ -73,7 +74,7 @@ function! s:generate_content_cn() abort endfunction function! s:generate_docker_content() abort - let layers = SpaceVim#util#globpath('~/.SpaceVim/', 'docs/cn/layers/**/*.md') + let layers = s:CMP.globpath('~/.SpaceVim/', 'docs/cn/layers/**/*.md') let list = [ \ ] call remove(layers, index(layers, '/home/wsdjeg/.SpaceVim/docs/cn/layers/index.md')) @@ -90,7 +91,7 @@ function! s:generate_docker_content() abort endfunction function! s:layer_list() abort - let layers = SpaceVim#util#globpath('~/.SpaceVim/', 'docs/layers/**/*.md') + let layers = s:CMP.globpath('~/.SpaceVim/', 'docs/layers/**/*.md') let list = [ \ '| Name | Description |', \ '| ---------- | ------------ |' @@ -115,7 +116,7 @@ function! s:layer_list() abort endfunction function! s:layer_list_cn() abort - let layers = SpaceVim#util#globpath('~/.SpaceVim/', 'docs/cn/layers/**/*.md') + let layers = s:CMP.globpath('~/.SpaceVim/', 'docs/cn/layers/**/*.md') let list = [ \ '| 名称 | 描述 |', \ '| ---------- | ------------ |' diff --git a/autoload/SpaceVim/health.vim b/autoload/SpaceVim/health.vim index 144e8e154..d5cf4ec50 100644 --- a/autoload/SpaceVim/health.vim +++ b/autoload/SpaceVim/health.vim @@ -6,8 +6,11 @@ " License: GPLv3 "============================================================================= +let s:CMP = SpaceVim#api#import('vim#compatible') + + function! SpaceVim#health#report() abort - let items = map(SpaceVim#util#globpath(&rtp,'autoload/SpaceVim/health/*'), "fnamemodify(v:val,':t:r')") + let items = map(s:CMP.globpath(&rtp,'autoload/SpaceVim/health/*'), "fnamemodify(v:val,':t:r')") let report = [] for item in items try diff --git a/autoload/SpaceVim/layers.vim b/autoload/SpaceVim/layers.vim index 68b5ef3ca..32d69730d 100644 --- a/autoload/SpaceVim/layers.vim +++ b/autoload/SpaceVim/layers.vim @@ -51,6 +51,7 @@ let s:layers_vars = {} let s:SYS = SpaceVim#api#import('system') +let s:CMP = SpaceVim#api#import('vim#compatible') "" " Load the {layer} you want. For all the layers SpaceVim supports, see @section(layers). @@ -120,7 +121,7 @@ function! s:list_layers() abort endfunction function! s:find_layers() abort - let layers = SpaceVim#util#globpath(&rtp, 'autoload/SpaceVim/layers/**/*.vim') + let layers = s:CMP.globpath(&rtp, 'autoload/SpaceVim/layers/**/*.vim') let pattern = s:SYS.isWindows ? '\\autoload\\SpaceVim\\layers\\' : '/autoload/SpaceVim/layers/' let rst = [] for layer in layers @@ -179,7 +180,7 @@ endfunction function! SpaceVim#layers#list() abort - let files = SpaceVim#util#globpath('.', 'autoload/SpaceVim/layers/**/*.vim') + let files = s:CMP.globpath('.', 'autoload/SpaceVim/layers/**/*.vim') let pattern = s:SYS.isWindows ? '\\autoload\\SpaceVim\\layers\\' : '/autoload/SpaceVim/layers/' let layers = [] for file in files diff --git a/autoload/SpaceVim/layers/tools/mpv.vim b/autoload/SpaceVim/layers/tools/mpv.vim index 57dc05a41..866b5e191 100644 --- a/autoload/SpaceVim/layers/tools/mpv.vim +++ b/autoload/SpaceVim/layers/tools/mpv.vim @@ -45,6 +45,7 @@ endif let s:JOB = SpaceVim#api#import('job') let s:NUM = SpaceVim#api#import('data#number') +let s:CMP = SpaceVim#api#import('vim#compatible') function! SpaceVim#layers#tools#mpv#config() abort @@ -90,7 +91,7 @@ function! SpaceVim#layers#tools#mpv#play(fpath) abort endfunction function! s:load_musics() abort - let musics = SpaceVim#util#globpath(s:musics_directory, '*.mp3') + let musics = s:CMP.globpath(s:musics_directory, '*.mp3') let g:unite_source_menu_menus.MpvPlayer.command_candidates = [] for m in musics call add(g:unite_source_menu_menus.MpvPlayer.command_candidates, diff --git a/autoload/SpaceVim/options.vim b/autoload/SpaceVim/options.vim index 188fdbb87..b704ba00f 100644 --- a/autoload/SpaceVim/options.vim +++ b/autoload/SpaceVim/options.vim @@ -5,7 +5,7 @@ " URL: https://spacevim.org " License: GPLv3 "============================================================================= -let s:CPT = SpaceVim#api#import('vim#compatible') +let s:CMP = SpaceVim#api#import('vim#compatible') function! SpaceVim#options#list() abort let list = [] @@ -15,7 +15,7 @@ function! SpaceVim#options#list() abort endfor else redraw - for var in filter(map(split(s:CPT.execute('let g:'), "\n"), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'") + for var in filter(map(split(s:CMP.execute('let g:'), "\n"), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'") call add(list, ' ' . var[11:] . ' = ' . string(get(g:, var , ''))) endfor endif diff --git a/autoload/SpaceVim/util.vim b/autoload/SpaceVim/util.vim index e625f6534..1de1e8b7e 100644 --- a/autoload/SpaceVim/util.vim +++ b/autoload/SpaceVim/util.vim @@ -10,7 +10,9 @@ let s:SYSTEM = SpaceVim#api#import('system') let s:FILE = SpaceVim#api#import('file') +" @deprecated SpaceVim#util#globpath is deprecated function! SpaceVim#util#globpath(path, expr) abort + call SpaceVim#logger#warn('SpaceVim#util#globpath will be removed in next release.') if has('patch-7.4.279') return globpath(a:path, a:expr, 1, 1) else