1

Regenerate nvim config

This commit is contained in:
2024-06-02 03:29:20 +02:00
parent 75eea0c030
commit ef2e28883d
5576 changed files with 604886 additions and 503 deletions

View File

@ -0,0 +1,70 @@
call themis#option('exclude', 'test/README.md')
call themis#option('exclude', 'test/Guardfile')
if $THEMIS_PROFILE !=# ''
execute 'profile' 'start' $THEMIS_PROFILE
profile! file ./autoload/*
profile! file ./plugin/*
profile! file ./syntax/*
endif
let s:helper = themis#helper('assert')
call themis#helper('command').with(s:helper)
function! GetPopupNoWait() abort
for b in range(1, bufnr('$'))
let p = getbufvar(b, '__gitmessenger_popup', v:null)
if p isnot v:null
return p
endif
endfor
return v:null
endfunction
function! GetPopup() abort
return CallWithTimeout(1, funcref('GetPopupNoWait'))
endfunction
function! CallWithTimeout(timeout, func) abort
let total = 0
while v:true
let v = a:func()
if v isnot v:null
return v
endif
sleep 100m
let total += 0.1
if total >= a:timeout
return v:null
endif
endwhile
endfunction
function! WaitUntil(func, ...) abort
let timeout = get(a:, 1, 1) " 1sec by default
let total = 0
while !a:func()
sleep 100m
let total += 0.1
if total >= timeout
" Note: v:true/v:false are not supported by themis.vim
" https://github.com/thinca/vim-themis/pull/56
return 0
endif
endwhile
return 1
endfunction
function! WaitWhile(func, ...) abort
return call('WaitUntil', [{-> !a:func()}] + a:000)
endfunction
function! Git(dir, ...) abort
let cmd = join(['git', '-C', shellescape(a:dir)] + a:000, ' ')
let out = system(cmd)
if v:shell_error
throw '`' . cmd . '` failed: ' . out
endif
return out
endfunction
let g:ON_TRAVIS = $TRAVIS !=# ''

View File

@ -0,0 +1,21 @@
def run(target)
target = target.to_s
success = if target.endwith? 'nvim.vimspec'
system({ 'THEMIS_VIM' => 'nvim' }, '../vim-themis/bin/themis', target)
else
system('../vim-themis/bin/themis', target)
end
puts(success ? 'OK' : 'NG')
end
guard :shell do
watch /^.+\.vim$/ do |m|
puts "Changed #{m[0]}. Run all tests."
run './test/'
end
watch /^.+\.vimspec$/ do |m|
puts "Changed #{m[0]}"
run m[0]
end
end

View File

@ -0,0 +1,49 @@
### How to Run tests
Setup:
```
$ cd /path/to/git-messenger.vim
$ git clone https://github.com/thinca/vim-themis.git
```
Run tests on `nvim`:
```
$ THEMIS_VIM=nvim ./vim-themis/bin/themis test/all.vimspec
```
Run tests on `vim`:
```
$ ./vim-themis/bin/themis test/all.vimspec
```
### How to run guard
Install [guard][] and [guard-shell][] as prerequisites.
```
$ guard -G test/Guardfile
```
It watches your file changes and runs tests automatically.
### How to take coverage
Set `$THEMIS_PROFILE` to take profiler log.
```
$ THEMIS_PROFILE=profile.txt ./vim-themis/bin/themis test/all.vimspec
```
It generates `profile.txt`. And run [covimerage][] to make a coverage file for `coverage` command.
```
$ covimerage write_coverage profile.txt
$ coverage report
```
[guard]: https://github.com/guard/guard
[guard-shell]: https://github.com/guard/guard-shell
[covimerage]: https://github.com/Vimjas/covimerage

File diff suppressed because it is too large Load Diff