mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:30:05 +08:00
add Codecov link to readme (#3898)
This commit is contained in:
parent
1c54f28654
commit
bd40c0935b
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=master)](https://travis-ci.org/SpaceVim/SpaceVim)
|
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=master)](https://travis-ci.org/SpaceVim/SpaceVim)
|
||||||
[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/master?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/master)
|
[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/master?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/master)
|
||||||
|
[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/master/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/master)
|
||||||
[![Docker Build Status](https://img.shields.io/docker/build/spacevim/spacevim.svg)](https://hub.docker.com/r/spacevim/spacevim/)
|
[![Docker Build Status](https://img.shields.io/docker/build/spacevim/spacevim.svg)](https://hub.docker.com/r/spacevim/spacevim/)
|
||||||
![Version](https://img.shields.io/badge/version-1.6.0--dev-8700FF.svg)
|
![Version](https://img.shields.io/badge/version-1.6.0--dev-8700FF.svg)
|
||||||
[![GPLv3 License](https://img.shields.io/badge/license-GPLv3-blue.svg)](LICENSE)
|
[![GPLv3 License](https://img.shields.io/badge/license-GPLv3-blue.svg)](LICENSE)
|
||||||
|
@ -277,7 +277,11 @@ function! s:self.displayArea() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:self.add_highlight(bufnr, hl, line, col, long) abort
|
function! s:self.add_highlight(bufnr, hl, line, col, long) abort
|
||||||
|
if exists('*nvim_buf_add_highlight')
|
||||||
|
call nvim_buf_add_highlight(a:bufnr, 0, a:hl, a:line, a:col, a:col + a:long)
|
||||||
|
else
|
||||||
|
call SpaceVim#logger#warn('vim#buffer.add_highlight api only support neovim', 0)
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:self.buf_get_lines(bufnr, start, end, strict_indexing) abort
|
function! s:self.buf_get_lines(bufnr, start, end, strict_indexing) abort
|
||||||
@ -295,7 +299,7 @@ function! s:self.buf_get_lines(bufnr, start, end, strict_indexing) abort
|
|||||||
if !bufloaded(a:bufnr)
|
if !bufloaded(a:bufnr)
|
||||||
call bufload(a:bufnr)
|
call bufload(a:bufnr)
|
||||||
endif
|
endif
|
||||||
return getbufline(a:bufnr, a:start + 1, a:end + 1)
|
return getbufline(a:bufnr, a:start + 1, a:end)
|
||||||
elseif a:start >= 0 && a:end < 0 && lct + a:end >= a:start
|
elseif a:start >= 0 && a:end < 0 && lct + a:end >= a:start
|
||||||
return self.buf_get_lines(a:bufnr, a:start, lct + a:end + 1, a:strict_indexing)
|
return self.buf_get_lines(a:bufnr, a:start, lct + a:end + 1, a:strict_indexing)
|
||||||
elseif a:start <= 0 && a:end > a:start && a:end < 0 && lct + a:start >= 0
|
elseif a:start <= 0 && a:end > a:start && a:end < 0 && lct + a:start >= 0
|
||||||
|
@ -24,17 +24,12 @@ Execute ( SpaceVim api: vim#buffer buf_set_lines):
|
|||||||
unlet nr
|
unlet nr
|
||||||
unlet buffer
|
unlet buffer
|
||||||
|
|
||||||
Execute ( SpaceVim api: vim#buffer add_highlight):
|
|
||||||
let buffer = SpaceVim#api#import('vim#buffer')
|
|
||||||
let highlit = SpaceVim#api#import('vim#highlight')
|
|
||||||
let nr = buffer.bufnr()
|
|
||||||
call buffer.add_highlight(nr,'String', 1, 1, 1)
|
|
||||||
AssertEqual highlit.syntax_at(1, 1), 'String'
|
|
||||||
|
|
||||||
Execute ( SpaceVim api: vim#buffer buf_get_lines):
|
Execute ( SpaceVim api: vim#buffer buf_get_lines):
|
||||||
let buffer = SpaceVim#api#import('vim#buffer')
|
let buffer = SpaceVim#api#import('vim#buffer')
|
||||||
let nr = buffer.bufadd('')
|
let nr = buffer.bufadd('')
|
||||||
call setbufvar(nr, '&buftype', 'nofile')
|
call setbufvar(nr, '&buftype', 'nofile')
|
||||||
call setbufvar(nr, '&buflisted', 0)
|
call setbufvar(nr, '&buflisted', 0)
|
||||||
call buffer.buf_set_lines(nr, 0, 1, 0, ['line 1', 'line 2', 'line 3', 'line 4'])
|
call buffer.buf_set_lines(nr, 0, 1, 0, ['line 1', 'line 2', 'line 3', 'line 4'])
|
||||||
AssertEqual buffer.buf_get_lines(nr, 1, 2, 0), ['line 2']
|
if has('patch-8.1.1610')
|
||||||
|
AssertEqual buffer.buf_get_lines(nr, 1, 2, 0), ['line 2']
|
||||||
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user