Skip to content

Commit

Permalink
feat: save jisyo_list_len and jisyo_path_list
Browse files Browse the repository at this point in the history
  • Loading branch information
kawarimidoll committed Nov 28, 2023
1 parent 6f8a36d commit 37ed048
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions k.vim
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ function! k#initialize(opts = {}) abort
let exists_user_jisyo = v:false
let s:jisyo_mark_pair = {}
let s:grep_cmd = ''
let s:jisyo_list_len = len(jisyo_list)
for jisyo in jisyo_list
if jisyo.path =~ ':'
echoerr "[k#initialize] jisyo.path must NOT includes ':'"
Expand All @@ -168,12 +169,17 @@ function! k#initialize(opts = {}) abort
endfor
if !exists_user_jisyo
" ユーザー辞書がリストに無ければ先頭に追加する
call insert(jisyo_list, { 'path': s:user_jisyo_path })
" マークはU エンコードはutf-8で固定
let s:jisyo_mark_pair[s:user_jisyo_path] = '[U] '
let s:grep_cmd = 'rg --no-heading --with-filename --no-line-number'
\ .. $" --encoding utf-8 '^:query:' {s:user_jisyo_path} 2>/dev/null; " .. s:grep_cmd
let s:jisyo_list_len += 1
endif

" 自動補完用 辞書の順位を保存する
let s:jisyo_path_list = map(jisyo_list, 'v:val.path')

" かなテーブル
let kana_table = get(a:opts, 'kana_table', k#default_kana_table())

Expand Down

0 comments on commit 37ed048

Please sign in to comment.