Skip to content

Commit

Permalink
feat: add use_google_cgi option
Browse files Browse the repository at this point in the history
  • Loading branch information
kawarimidoll committed Nov 28, 2023
1 parent d27fdc6 commit 7c99564
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions k.vim
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ function! k#initialize(opts = {}) abort
" 自動補完最小文字数 (0の場合は自動補完しない)
let s:min_auto_complete_length = get(a:opts, 'min_auto_complete_length', 0)

" Google CGI変換
let s:use_google_cgi = get(a:opts, 'use_google_cgi', v:false)

" 'っ'が連続したら1回と見做す
let s:merge_tsu = get(a:opts, 'merge_tsu', v:false)

Expand Down Expand Up @@ -422,7 +425,7 @@ function! k#completefunc(suffix_key = '')
\ 'suffix_key': a:suffix_key,
\ }

if !google_exists && a:suffix_key ==# ''
if s:use_google_cgi && !google_exists && a:suffix_key ==# ''
call add(comp_list, {
\ 'word': preceding_str,
\ 'abbr': '[Google変換]',
Expand Down Expand Up @@ -656,6 +659,7 @@ call k#initialize({
\ { 'path': expand('~/.cache/vim/SKK-JISYO.jawiki'), 'encoding': 'utf-8', 'mark': 'W' },
\ { 'path': expand('~/.cache/vim/SKK-JISYO.emoji'), 'encoding': 'utf-8' },
\ ],
\ 'min_auto_complete_length': 2
\ 'min_auto_complete_length': 2,
\ 'use_google_cgi': v:true,
\ 'merge_tsu': v:true,
\ })

0 comments on commit 7c99564

Please sign in to comment.