mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-14 23:49:19 +08:00
update messletters api
This commit is contained in:
parent
c58508d66d
commit
2fd58a97f4
@ -9,11 +9,98 @@ function! s:bubble_num(num, type) abort
|
||||
call add(list,['➊', '➋', '➌', '➍', '➎', '➏', '➐', '➑', '➒', '➓'])
|
||||
call add(list,['➀', '➁', '➂', '➃', '➄', '➅', '➆', '➇', '➈', '➉'])
|
||||
call add(list,['⓵', '⓶', '⓷', '⓸', '⓹', '⓺', '⓻', '⓼', '⓽', '⓾'])
|
||||
return list[a:type][a:num-1]
|
||||
let n = ''
|
||||
try
|
||||
let n = list[a:type][a:num-1]
|
||||
catch
|
||||
endtry
|
||||
return n
|
||||
endfunction
|
||||
|
||||
let s:chars['bubble_num'] = function('s:bubble_num')
|
||||
|
||||
" type :
|
||||
" 0: 1 ➛ ➊
|
||||
" 1: 1 ➛ ➀
|
||||
" 2: 1 ➛ ⓵
|
||||
function! s:circled_num(num, type) abort
|
||||
" http://www.unicode.org/charts/beta/nameslist/n_2460.html
|
||||
if a:type == 0
|
||||
if a:num == 0
|
||||
return nr2char(9471)
|
||||
elseif index(range(1,10), a:num) != -1
|
||||
return nr2char(10102 + a:num - 1)
|
||||
elseif index(range(11, 20), a:num)
|
||||
return nr2char(9451 + a:num - 11)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
elseif a:type == 1
|
||||
if index(range(20), a:num) != -1
|
||||
if a:num == 0
|
||||
return nr2char(9450)
|
||||
else
|
||||
return nr2char(9311 + a:num)
|
||||
endif
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
elseif a:type == 2
|
||||
if index(range(1, 10), a:num) != -1
|
||||
return nr2char(9461 + a:num - 1)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:chars['circled_num'] = function('s:circled_num')
|
||||
|
||||
function! s:parenthesized_num(num) abort
|
||||
" http://www.unicode.org/charts/beta/nameslist/n_2460.html
|
||||
if index(range(1, 20), a:num) != -1
|
||||
return nr2char(9331 + a:num)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:chars['parenthesized_num'] = function('s:parenthesized_num')
|
||||
|
||||
function! s:num_period(num) abort
|
||||
" http://www.unicode.org/charts/beta/nameslist/n_2460.html
|
||||
if index(range(1, 20), a:num) != -1
|
||||
return nr2char(9351 + a:num)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:chars['num_period'] = function('s:num_period')
|
||||
|
||||
function! s:parenthesized_letter(letter) abort
|
||||
" http://www.unicode.org/charts/beta/nameslist/n_2460.html
|
||||
if index(range(1, 26), char2nr(a:letter) - 96) != -1
|
||||
return nr2char(9371 + char2nr(a:letter) - 96)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:chars['parenthesized_letter'] = function('s:parenthesized_letter')
|
||||
|
||||
function! s:circled_letter(letter) abort
|
||||
" http://www.unicode.org/charts/beta/nameslist/n_2460.html
|
||||
if index(range(1, 26), char2nr(a:letter) - 64) != -1
|
||||
return nr2char(9397 + char2nr(a:letter) - 64)
|
||||
elseif index(range(1, 26), char2nr(a:letter) - 96) != -1
|
||||
return nr2char(9423 + char2nr(a:letter) - 96)
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:chars['circled_letter'] = function('s:circled_letter')
|
||||
|
||||
function! SpaceVim#api#messletters#get() abort
|
||||
return deepcopy(s:chars)
|
||||
|
Loading…
x
Reference in New Issue
Block a user