1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 20:20:05 +08:00

add language mapping test (#4431)

This commit is contained in:
Wang Shidong 2021-08-27 11:47:11 +08:00 committed by GitHub
parent d807b9bf8d
commit 4006e9b912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 0 deletions

View File

@ -58,6 +58,13 @@ function! s:language_specified_mappings() abort
\ 'compile-to-html', 1)
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
call SpaceVim#layers#lang#asciidoc#plugins()
call SpaceVim#layers#lang#asciidoc#config()

View File

@ -694,6 +694,12 @@ function! SpaceVim#mapping#space#regesit_lang_mappings(ft, func) abort
call extend(s:language_specified_mappings, {a:ft : a:func})
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
if s:has_map_to_spc()
return

View File

@ -4,3 +4,14 @@ Execute ( SpaceVim layer health: ):
Assert SpaceVim#layers#{layer}#health(), 'function SpaceVim#layers#' . layer . '#health() return false'
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