1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:40:06 +08:00

fix(number): fix the pattern of Chinese Number

This commit is contained in:
Kun Lin 2022-02-19 08:55:59 +08:00 committed by GitHub
parent 489edbaeda
commit dfb8b10556
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,10 +59,10 @@ endfunction
function! s:ConvertChineseNumberUnderCursorToDigit() abort
let cword = expand('<cword>')
let ChineseNumberPattern = "[〇一二三四五六七八九零壹贰叁肆伍陆柒捌玖貮两点]\+"
let ChineseNumberPattern = '[〇一二三四五六七八九十百千万亿兆零壹贰叁肆伍陆柒捌玖拾佰仟萬億貮两点]\+'
while cword =~ ChineseNumberPattern
let matchword = matchstr(cword, ChineseNumberPattern)
let cword = substitute(cword, matchword, s:Chinese2Digit(matchword))
let cword = substitute(cword, matchword, s:Chinese2Digit(matchword), "")
endwhile
if !empty(cword)
let save_register = @k