mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 08:30:06 +08:00
add language mapping test (#4431)
This commit is contained in:
parent
d807b9bf8d
commit
4006e9b912
@ -58,6 +58,13 @@ function! s:language_specified_mappings() abort
|
|||||||
\ 'compile-to-html', 1)
|
\ 'compile-to-html', 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:compile_to_html() abort
|
||||||
|
let input = expand('%')
|
||||||
|
let target = fnamemodify(input, ':r') . '.html'
|
||||||
|
let cmd = printf('asciidoc -o %s %s', target, input)
|
||||||
|
call system(cmd)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#asciidoc#health() abort
|
function! SpaceVim#layers#lang#asciidoc#health() abort
|
||||||
call SpaceVim#layers#lang#asciidoc#plugins()
|
call SpaceVim#layers#lang#asciidoc#plugins()
|
||||||
call SpaceVim#layers#lang#asciidoc#config()
|
call SpaceVim#layers#lang#asciidoc#config()
|
||||||
|
@ -694,6 +694,12 @@ function! SpaceVim#mapping#space#regesit_lang_mappings(ft, func) abort
|
|||||||
call extend(s:language_specified_mappings, {a:ft : a:func})
|
call extend(s:language_specified_mappings, {a:ft : a:func})
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! SpaceVim#mapping#space#get_lang_mappings(ft) abort
|
||||||
|
|
||||||
|
return get(s:language_specified_mappings, a:ft, '')
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#mapping#space#langSPC(m, keys, cmd, desc, is_cmd, ...) abort
|
function! SpaceVim#mapping#space#langSPC(m, keys, cmd, desc, is_cmd, ...) abort
|
||||||
if s:has_map_to_spc()
|
if s:has_map_to_spc()
|
||||||
return
|
return
|
||||||
|
@ -4,3 +4,14 @@ Execute ( SpaceVim layer health: ):
|
|||||||
Assert SpaceVim#layers#{layer}#health(), 'function SpaceVim#layers#' . layer . '#health() return false'
|
Assert SpaceVim#layers#{layer}#health(), 'function SpaceVim#layers#' . layer . '#health() return false'
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
Execute ( SpaceVim language mapping: ):
|
||||||
|
for layer in SpaceVim#layers#list()
|
||||||
|
Log 'testing ' . layer . ' language key bindings'
|
||||||
|
let LMAPF = SpaceVim#mapping#space#get_lang_mappings(get(split(layer, '#'), 1, ''))
|
||||||
|
if !empty(LMAPF)
|
||||||
|
call call(LMAPF, [])
|
||||||
|
" https://github.com/vim/vim/commit/f6f32c38bf3319144a84a01a154c8c91939e7acf
|
||||||
|
endif
|
||||||
|
unlet LMAPF
|
||||||
|
endfor
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user