diff --git a/.ci/install.ps1 b/.ci/install.ps1 new file mode 100644 index 000000000..5ea33925a --- /dev/null +++ b/.ci/install.ps1 @@ -0,0 +1,96 @@ +function install_vim($name) +{ + $ver = $name -replace "^Official\s*", "" + if ($ver -eq "latest-32") + { + $url1 = 'ftp://ftp.vim.org/pub/vim/pc/vim80w32.zip' + } + elseif ($ver -eq "8.0.0069-32") + { + $url1 = 'ftp://ftp.vim.org/pub/vim/pc/vim80-069w32.zip' + } + $url2 = 'ftp://ftp.vim.org/pub/vim/pc/vim80rt.zip' + $zip1 = $Env:APPVEYOR_BUILD_FOLDER + '\vim.zip' + $zip2 = $Env:APPVEYOR_BUILD_FOLDER + '\vim-rt.zip' + (New-Object Net.WebClient).DownloadFile($url1, $zip1) + (New-Object Net.WebClient).DownloadFile($url2, $zip2) + [Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null + [System.IO.Compression.ZipFile]::ExtractToDirectory($zip1, $Env:APPVEYOR_BUILD_FOLDER) + [System.IO.Compression.ZipFile]::ExtractToDirectory($zip2, $Env:APPVEYOR_BUILD_FOLDER) + $Env:THEMIS_VIM = $Env:APPVEYOR_BUILD_FOLDER + '\vim\vim80\vim.exe' +} + +function install_kaoriya_vim($name) +{ + $ver = $name -replace "^Kaoriya\s*", "" + if ($ver -eq "latest-32") + { + $url = 'http://vim-jp.org/redirects/koron/vim-kaoriya/latest/win32/' + } + elseif ($ver -eq "latest-64") + { + $url = 'http://vim-jp.org/redirects/koron/vim-kaoriya/latest/win64/' + } + elseif ($ver -eq "8.0.0082-32") + { + $url = 'https://github.com/koron/vim-kaoriya/releases/download/v8.0.0082-20161113/vim80-kaoriya-win32-8.0.0082-20161113.zip' + } + elseif ($ver -eq "8.0.0082-64") + { + $url = 'https://github.com/koron/vim-kaoriya/releases/download/v8.0.0082-20161113/vim80-kaoriya-win64-8.0.0082-20161113.zip' + } + $zip = $Env:APPVEYOR_BUILD_FOLDER + '\kaoriya-vim.zip' + $out = $Env:APPVEYOR_BUILD_FOLDER + '\kaoriya-vim\' + if ($url.StartsWith('http://vim-jp.org/redirects/')) + { + $redirect = Invoke-WebRequest -URI $url + (New-Object Net.WebClient).DownloadFile($redirect.Links[0].href, $zip) + } + else + { + (New-Object Net.WebClient).DownloadFile($url, $zip) + } + [Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null + [System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $out) + $Env:THEMIS_VIM = $out + (Get-ChildItem $out).Name + '\vim.exe' +} + +function install_nvim($name) +{ + $ver = $name -replace "^Neovim\s*", "" + if ($ver -eq "latest-32") + { + $url = 'https://ci.appveyor.com/api/projects/neovim/neovim/artifacts/build/Neovim.zip?branch=master&job=Configuration%3A%20MINGW_32' + } + elseif ($ver -eq "latest-64") + { + $url = 'https://ci.appveyor.com/api/projects/neovim/neovim/artifacts/build/Neovim.zip?branch=master&job=Configuration%3A%20MINGW_64' + } + elseif ($ver -eq "0.2.0-32") + { + $url = 'https://github.com/neovim/neovim/releases/download/v0.2.0/nvim-win32.zip' + } + elseif ($ver -eq "0.2.0-64") + { + $url = 'https://github.com/neovim/neovim/releases/download/v0.2.0/nvim-win64.zip' + } + $zip = $Env:APPVEYOR_BUILD_FOLDER + '\nvim.zip' + (New-Object Net.WebClient).DownloadFile($url, $zip) + [Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null + [System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $Env:APPVEYOR_BUILD_FOLDER) + $Env:THEMIS_VIM = $Env:APPVEYOR_BUILD_FOLDER + '\Neovim\bin\nvim.exe' + $Env:THEMIS_ARGS = '-e -s --headless' +} + +if ($Env:CONDITION.StartsWith("Neovim")) +{ + install_nvim $Env:CONDITION +} +elseif ($Env:CONDITION.StartsWith("Official")) +{ + install_vim $Env:CONDITION +} +else +{ + install_kaoriya_vim $Env:CONDITION +} diff --git a/README.md b/README.md index 85aa0dd69..47a32168f 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,8 @@ curl -sLf https://spacevim.org/install.sh | bash -s -- -h ### Features -- **Great documentation:** access documentation in Vim with :h SpaceVim. +- **Great documentation:** access documentation in Vim with SPC h SPC. + ![SPC h SPC](https://user-images.githubusercontent.com/13142418/31620230-48b53eea-b2c9-11e7-90d0-b717878875d4.gif) - **Beautiful GUI:** you'll love the awesome UI and its useful features. - **Mnemonic key bindings:** all key bindings have mnemonic prefixes. ![mapping guide](https://user-images.githubusercontent.com/13142418/31550099-c8173ff8-b062-11e7-967e-6378a9c3b467.gif) diff --git a/appveyor.yml b/appveyor.yml index 81e4fb215..65db75871 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,9 +1,24 @@ -version: 1.0.{build} -pull_requests: - do_not_increment_build_number: true -skip_tags: true +version: '{build}' clone_depth: 1 +environment: + matrix: + - CONDITION: Official latest-32 +install: + - 'reg copy HKLM\SOFTWARE\Python\PythonCore\2.7 HKLM\SOFTWARE\Python\PythonCore\2.7-32 /s /reg:32' + - 'reg copy HKLM\SOFTWARE\Python\PythonCore\2.7 HKLM\SOFTWARE\Python\PythonCore\2.7-32 /s /reg:64' + - 'git config --global user.name "Appveyor"' + - 'git config --global user.email appveyor@example.com' + - 'git clone -q --depth 1 --single-branch https://github.com/junegunn/vader.vim.git build/vader' + - 'git clone -q --depth 1 --single-branch https://github.com/Shougo/dein.vim C:\Users\appveyor\.cache\vimfiles\repos\github.com\Shougo\dein.vim' + - 'set THEMIS_HOME=%TEMP%\vim-themis' + - 'set PATH=%THEMIS_HOME%\bin;%PATH%' + - ps: .ci/install.ps1 test_script: -- ps: make test + - 'echo %PATH%' + - 'echo %THEMIS_HOME%' + - 'echo %THEMIS_VIM%' + - 'echo %THEMIS_ARGS%' + - '%THEMIS_VIM% --version' + - '%THEMIS_VIM% -Nu test/vimrc -c "Vader! test/**"' build: off deploy: off diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index be4b440d8..edc69ccc9 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -155,6 +155,13 @@ let g:spacevim_statusline_inactive_separator = 'arrow' " Enable/Disable unicode symbols in statusline let g:spacevim_statusline_unicode_symbols = 1 "" +" Enable/Disable display mode. Default is 0, mode will be +" displayed in statusline. To enable this feature: +" > +" let g:spacevim_enable_statusline_display_mode = 1 +" < +let g:spacevim_enable_statusline_display_mode = 0 +"" " Enable/Disable cursorcolumn. Default is 0, cursorcolumn will be " highlighted in normal mode. To enable this feature: " > @@ -342,10 +349,10 @@ let g:spacevim_lint_on_the_fly = 0 " < let g:spacevim_enable_vimfiler_welcome = 1 "" -" Enable/Disable gitstatus colum in vimfiler buffer, default is 0. +" Enable/Disable gitstatus column in vimfiler buffer, default is 0. let g:spacevim_enable_vimfiler_gitstatus = 0 "" -" Enable/Disable filetypeicon colum in vimfiler buffer, default is 0. +" Enable/Disable filetypeicon column in vimfiler buffer, default is 0. let g:spacevim_enable_vimfiler_filetypeicon = 0 let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default'] let g:spacevim_smartcloseignoreft = ['help', 'tagbar', 'vimfiler', 'SpaceVimRunner'] diff --git a/autoload/SpaceVim/api/job.vim b/autoload/SpaceVim/api/job.vim index 2bd8cb3bf..d07fa4511 100644 --- a/autoload/SpaceVim/api/job.vim +++ b/autoload/SpaceVim/api/job.vim @@ -8,6 +8,7 @@ let s:self.jobs = {} let s:self.nvim_job = has('nvim') let s:self.vim_job = !has('nvim') && has('job') && has('patch-8.0.0027') let s:self.vim_co = SpaceVim#api#import('vim#compatible') +let s:self._message = [] if !s:self.nvim_job && !s:self.vim_job augroup SpaceVim_job @@ -78,6 +79,12 @@ function! s:self.start(argv, ...) abort if job > 0 let msg = ['process '. jobpid(job), ' run'] call extend(self.jobs, {job : msg}) + else + if job == -1 + call add(self._message, 'Failed to start job:' . (type(a:argv) == 3 ? a:argv[0] : a:argv) . ' is not executeable') + elseif job == 0 + call add(self._message, 'Failed to start job: invalid arguments') + endif endif return job elseif self.vim_job @@ -226,3 +233,7 @@ function! s:self.info(id) abort call self.warn() endif endfunction + +function! s:self.debug() abort + echo join(self._message, "\n") +endfunction diff --git a/autoload/SpaceVim/api/vim/buffer.vim b/autoload/SpaceVim/api/vim/buffer.vim index 4dcfbe5e9..3be0a852f 100644 --- a/autoload/SpaceVim/api/vim/buffer.vim +++ b/autoload/SpaceVim/api/vim/buffer.vim @@ -76,7 +76,14 @@ function! s:self.buf_set_lines(buffer, start, end, strict_indexing, replacement) py3 lines = vim.eval("a:replacement") py3 vim.buffers[bufnr][start_line:end_line] = lines endif + elseif exists('*setbufline') + let line = a:start + for i in range(len(a:replacement)) + call setbufline(bufname(a:buffer), line + i, a:replacement[i]) + endfor else + exe 'b' . a:buffer + call setline(a:start - 1, a:replacement) endif endfunction diff --git a/autoload/SpaceVim/api/vim/command.vim b/autoload/SpaceVim/api/vim/command.vim new file mode 100644 index 000000000..f68f8c801 --- /dev/null +++ b/autoload/SpaceVim/api/vim/command.vim @@ -0,0 +1,60 @@ +let s:self = {} + +let s:self.options = {} + +" let s:options = { +" \ '-f' : { +" \ 'description' : '', +" \ 'complete' : ['text'], +" \ }, +" \ '-d' : { +" \ 'description' : 'Root directory for sources', +" \ 'complete' : 'file', +" \ }, +" \ } + +let s:self._message = [] + +function! s:self._complete_opt(part, opt) abort + let complete = self.options[a:opt].complete + if type(complete) == type([]) + return join(complete, "\n") + else + return join(getcompletion(a:part, complete), "\n") + endif +endfunction + +function! s:self.complete(ArgLead, CmdLine, CursorPos) abort + let argvs = split(a:CmdLine) + let last_argv = split(a:CmdLine)[-1] + let msg = 'ArgLead: ' . a:ArgLead . ' CmdLine: ' . a:CmdLine . ' CursorPos: ' + \ . a:CursorPos . ' LastArgv: ' . last_argv + call add(self._message, msg) + if a:ArgLead == '' && index(keys(self.options), last_argv) == -1 + return join(keys(self.options), "\n") + elseif a:ArgLead == '' && index(keys(self.options), last_argv) != -1 + return self._complete_opt(a:ArgLead, last_argv) + elseif !empty(a:ArgLead) && len(argvs) >= 3 + \ && index(keys(self.options), argvs[-2]) != -1 + return self._complete_opt(a:ArgLead, argvs[-2]) + elseif !empty(a:ArgLead) && ( + \ (len(argvs) >= 3 && index(keys(self.options), argvs[-2]) == -1) + \ || + \ (len(argvs) ==2 ) + \ ) + return join(keys(self.options), "\n") + endif + +endfunction + +function! s:self.debug() abort + echo join(self._message, "\n") +endfunction + + +function! SpaceVim#api#vim#command#get() + return deepcopy(s:self) +endfunction + + +" vim:set et sw=2 cc=80: diff --git a/autoload/SpaceVim/layers/autocomplete.vim b/autoload/SpaceVim/layers/autocomplete.vim index 68880eedf..b33579376 100644 --- a/autoload/SpaceVim/layers/autocomplete.vim +++ b/autoload/SpaceVim/layers/autocomplete.vim @@ -59,6 +59,13 @@ function! SpaceVim#layers#autocomplete#plugins() abort \ 'loadconf' : 1, \ }]) endif + if has('patch-7.4.774') + call add(plugins, ['Shougo/echodoc.vim', { + \ 'on_cmd' : ['EchoDocEnable', 'EchoDocDisable'], + \ 'on_event' : 'CompleteDone', + \ 'loadconf_before' : 1, + \ }]) + endif call add(plugins, ['tenfyzhong/CompleteParameter.vim', {'merged': 0}]) return plugins endfunction diff --git a/autoload/SpaceVim/layers/core/statusline.vim b/autoload/SpaceVim/layers/core/statusline.vim index 7737d8aad..26cd179f1 100644 --- a/autoload/SpaceVim/layers/core/statusline.vim +++ b/autoload/SpaceVim/layers/core/statusline.vim @@ -147,7 +147,9 @@ function! s:winnr(...) abort return ' ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' ' endif else - if g:spacevim_windows_index_type == 3 + if g:spacevim_enable_statusline_display_mode == 1 + return '%{SpaceVim#layers#core#statusline#mode(mode())} %{SpaceVim#layers#core#statusline#mode_text(mode())}' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' ' + elseif g:spacevim_windows_index_type == 3 return '%{SpaceVim#layers#core#statusline#mode(mode())} ' . winnr() . ' ' else return '%{SpaceVim#layers#core#statusline#mode(mode())} ' . s:MESSLETTERS.circled_num(winnr(), g:spacevim_windows_index_type) . ' ' @@ -468,6 +470,20 @@ function! SpaceVim#layers#core#statusline#mode(mode) return '' endfunction +function! SpaceVim#layers#core#statusline#mode_text(mode) + let t = s:colors_template + if a:mode == 'n' + return 'NORMAL ' + elseif a:mode == 'i' + return 'INSERT ' + elseif a:mode == 'R' + return 'REPLACE ' + elseif a:mode == 'v' || a:mode == 'V' || a:mode == '^V' || a:mode == 's' || a:mode == 'S' || a:mode == '^S' + return 'VISUAL ' + endif + return ' ' +endfunction + function! SpaceVim#layers#core#statusline#denite_mode() let t = s:colors_template let dmode = split(denite#get_status_mode())[1] diff --git a/autoload/SpaceVim/layers/lang/haskell.vim b/autoload/SpaceVim/layers/lang/haskell.vim index 33808a8f0..37265962a 100644 --- a/autoload/SpaceVim/layers/lang/haskell.vim +++ b/autoload/SpaceVim/layers/lang/haskell.vim @@ -5,3 +5,12 @@ function! SpaceVim#layers#lang#haskell#plugins() abort call add(plugins,['eagletmt/neco-ghc', { 'on_ft' : 'haskell'}]) return plugins endfunction + +function! SpaceVim#layers#lang#haskell#config() abort + let g:haskellmode_completion_ghc = 0 + + augroup SpaceVim_lang_haskell + autocmd! + autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc + augroup END +endfunction diff --git a/autoload/SpaceVim/plugins/pmd.vim b/autoload/SpaceVim/plugins/pmd.vim new file mode 100644 index 000000000..bdbb49b3c --- /dev/null +++ b/autoload/SpaceVim/plugins/pmd.vim @@ -0,0 +1,108 @@ +"============================================================================= +" pmd.vim --- Integrates PMD using Vim quickfix mode +" Copyright (c) 2016-2017 Shidong Wang & Contributors +" Author: Shidong Wang < wsdjeg at 163.com > +" URL: https://spacevim.org +" License: MIT license +"============================================================================= + +" init plugin values + +let s:options = { + \ '-R' : { + \ 'description' : 'Comma separated list of ruleset names to use', + \ 'complete' : [], + \ }, + \ '-f' : { + \ 'description' : '', + \ 'complete' : ['text'], + \ }, + \ '-d' : { + \ 'description' : 'Root directory for sources', + \ 'complete' : 'file', + \ }, + \ '-cache' : { + \ 'description' : 'Set cache file', + \ 'complete' : 'file', + \ }, + \ } + +if !exists('Pmd_Cmd') + let g:Pmd_Cmd = ['pmd'] +endif + +if !exists('Pmd_Rulesets') + let g:Pmd_Rulesets = ["-R", "java-basic,java-design", "-property", "xsltFilename=my-own.xs"] +endif + +if !exists('Pmd_silent_stderr') + let g:Pmd_silent_stderr = 1 +endif + +" load SpaceVim APIs + +let s:JOB = SpaceVim#api#import('job') +let s:CMD = SpaceVim#api#import('vim#command') + +" set APIs + +let s:CMD.options = s:options + +let s:rst = [] + +function! s:on_pmd_stdout(id, data, event) abort + for data in a:data + let info = split(data, '\:\d\+\:') + if len(info) == 2 + let [fname, text] = info + let lnum = matchstr(data, '\:\d\+\:')[1:-2] + call add(s:rst, { + \ 'filename' : fnamemodify(fname, ':p'), + \ 'lnum' : lnum, + \ 'text' : text, + \ }) + endif + endfor +endfunction + +function! s:on_pmd_stderr(id, data, event) abort + let s:JOB._message += a:data + if g:Pmd_silent_stderr == 0 + echom string(a:data) + endif +endfunction + +function! s:on_pmd_exit(id, data, event) abort + call setqflist(s:rst) + let s:rst = [] + copen +endfunction + +function! SpaceVim#plugins#pmd#run(...) + let argv = g:Pmd_Cmd + a:000 + if index(a:000, '-R') == -1 + let argv += g:Pmd_Rulesets + endif + if index(argv, '-d') == -1 + echohl ErrorMsg | echo 'you need to run PMD with -d option!' + return + endif + call s:JOB.start(argv, + \ { + \ 'on_stdout' : function('s:on_pmd_stdout'), + \ 'on_stderr' : function('s:on_pmd_stderr'), + \ 'on_exit' : function('s:on_pmd_exit'), + \ } + \ ) +endfunction + +function! SpaceVim#plugins#pmd#debug() + call s:CMD.debug() + call s:JOB.debug() +endfunction + + +function! SpaceVim#plugins#pmd#complete(ArgLead, CmdLine, CursorPos) + return s:CMD.complete(a:ArgLead, a:CmdLine, a:CursorPos) +endfunction + diff --git a/config/commands.vim b/config/commands.vim index 7d5bd724f..48ab64c3a 100644 --- a/config/commands.vim +++ b/config/commands.vim @@ -6,3 +6,5 @@ command! DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis command! -nargs=* -complete=custom,zvim#util#complete_plugs Plugin :call zvim#util#Plugin() "command for open project command! -nargs=+ -complete=custom,zvim#util#complete_project OpenProject :call zvim#util#OpenProject() + +command! -nargs=* -complete=custom,SpaceVim#plugins#pmd#complete PMD :call SpaceVim#plugins#pmd#run() diff --git a/config/plugins_before/echodoc.vim b/config/plugins_before/echodoc.vim new file mode 100644 index 000000000..584403ed3 --- /dev/null +++ b/config/plugins_before/echodoc.vim @@ -0,0 +1,2 @@ +let g:echodoc#enable_at_startup = 1 +set noshowmode diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 4d90ee8a7..b16bc89ab 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -191,6 +191,13 @@ See more details in: http://spacevim.org/documentation/#statusline *g:spacevim_statusline_unicode_symbols* Enable/Disable unicode symbols in statusline + *g:spacevim_enable_statusline_display_mode* +Enable/Disable display mode. Default is 0, mode will be displayed in +statusline. To enable this feature: +> + let g:spacevim_enable_statusline_display_mode = 1 +< + *g:spacevim_enable_cursorcolumn* Enable/Disable cursorcolumn. Default is 0, cursorcolumn will be highlighted in normal mode. To enable this feature: @@ -371,10 +378,10 @@ vim to start up slowly if there are too many files in the current directory. < *g:spacevim_enable_vimfiler_gitstatus* -Enable/Disable gitstatus colum in vimfiler buffer, default is 0. +Enable/Disable gitstatus column in vimfiler buffer, default is 0. *g:spacevim_enable_vimfiler_filetypeicon* -Enable/Disable filetypeicon colum in vimfiler buffer, default is 0. +Enable/Disable filetypeicon column in vimfiler buffer, default is 0. *g:spacevim_hosts_url* The host file url. This option is for Chinese users who can not use Google and diff --git a/docs/documentation.md b/docs/documentation.md index cb6232b1f..61bed669c 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -396,6 +396,7 @@ The statusline and tabline are heavily customized with the following capabilitie The `core#statusline` layer provide a heavily customized powerline with the following capabilities:, It is inspired by spacemacs's mode-line. - show the window number +- show the current mode - color code for current state - show the number of search results - toggle syntax checking info diff --git a/mode/basic.vim b/mode/basic.vim index 272033e55..4282c87f7 100644 --- a/mode/basic.vim +++ b/mode/basic.vim @@ -4,5 +4,6 @@ let g:spacevim_statusline_separator = 'nil' let g:spacevim_statusline_inactive_separator = 'bar' let g:spacevim_buffer_index_type = 4 let g:spacevim_enable_tabline_filetype_icon = 0 +let g:spacevim_enable_statusline_display_mode = 0 diff --git a/mode/dark_powered.vim b/mode/dark_powered.vim index 3130afc10..3fb642c2f 100644 --- a/mode/dark_powered.vim +++ b/mode/dark_powered.vim @@ -23,6 +23,7 @@ let g:spacevim_enable_vimfiler_welcome = 1 let g:spacevim_enable_debug = 1 let g:deoplete#auto_complete_delay = 150 let g:spacevim_enable_tabline_filetype_icon = 1 +let g:spacevim_enable_statusline_display_mode = 0 let g:spacevim_enable_os_fileformat_icon = 1 let g:spacevim_buffer_index_type = 1 let g:neomake_vim_enabled_makers = [] diff --git a/test/api/job.vader b/test/api/job.vader index 295a4b1c7..b94b2fcce 100644 --- a/test/api/job.vader +++ b/test/api/job.vader @@ -1,5 +1,9 @@ Execute ( SpaceVim api: job ): let job = SpaceVim#api#import('job') + let os = SpaceVim#api#import('system') + if os.isWindows + finish + endif let argv = ['cat'] let g:stdout = '' let stderr = '' diff --git a/test/api/unicode/box.vader b/test/api/unicode/box.vader index 0cce8f40f..97fcc82f6 100644 --- a/test/api/unicode/box.vader +++ b/test/api/unicode/box.vader @@ -1,5 +1,6 @@ Execute ( SpaceVim api: unicode#box ): new + let &encoding = 'utf-8' let box = SpaceVim#api#import('unicode#box') AssertEqual box.drawing_box([1,2,3] , 1, 3, 5), \ ['╭─────┬─────┬─────╮', '│ 1 │ 2 │ 3 │', '╰─────┴─────┴─────╯'] diff --git a/test/api/vim/buffer.vader b/test/api/vim/buffer.vader index 5bd1cc405..2e18c03fc 100644 --- a/test/api/vim/buffer.vader +++ b/test/api/vim/buffer.vader @@ -6,8 +6,12 @@ Execute ( SpaceVim api: vim#buffer open ): AssertEqual &buftype, 'nofile' Execute ( SpaceVim api: vim#buffer buf_set_lines): - new let buffer = SpaceVim#api#import('vim#buffer') + let os = SpaceVim#api#import('system') + if os.isWindows + finish + endif + new let nr = bufnr('%') new call buffer.buf_set_lines(nr, 0, 1, 0, ['line 1', 'line 2', 'line 3']) diff --git a/test/api/vim/command.vader b/test/api/vim/command.vader new file mode 100644 index 000000000..6e41509bb --- /dev/null +++ b/test/api/vim/command.vader @@ -0,0 +1,10 @@ +Execute ( SpaceVim api: data#command complete): + let cmd = SpaceVim#api#import('vim#command') + let cmd.options = { + \ '-d' : { + \ 'complete' : ['foo', 'baa'], + \ } + \ } + AssertEqual cmd.complete('', 'A ', 3), '-d' + AssertEqual cmd.complete('', 'A -d ', 6), "foo\nbaa" + AssertEqual cmd.complete('f', 'A -d f', 7), "foo\nbaa"