Skip to content

Commit

Permalink
fix: use input mark as-is
Browse files Browse the repository at this point in the history
  • Loading branch information
kawarimidoll committed Nov 30, 2023
1 parent 9279740 commit b09fe5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions k.vim
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,9 @@ let uj = expand('~/.cache/vim/SKK-JISYO.user')
call k#initialize({
\ 'user_jisyo_path': uj,
\ 'jisyo_list': [
\ { 'path': expand('~/.cache/vim/SKK-JISYO.L'), 'encoding': 'euc-jp', 'mark': 'L' },
\ { 'path': uj, 'encoding': 'utf-8', 'mark': 'U' },
\ { 'path': expand('~/.cache/vim/SKK-JISYO.geo'), 'encoding': 'euc-jp', 'mark': 'G' },
\ { 'path': expand('~/.cache/vim/SKK-JISYO.jawiki'), 'encoding': 'utf-8', 'mark': 'W' },
\ { 'path': expand('~/.cache/vim/SKK-JISYO.L'), 'encoding': 'euc-jp', 'mark': '[L]' },
\ { 'path': expand('~/.cache/vim/SKK-JISYO.geo'), 'encoding': 'euc-jp', 'mark': '[G]' },
\ { '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,
Expand Down
4 changes: 2 additions & 2 deletions opts.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function! opts#parse(opts) abort
if indexof(s:jisyo_list, $'v:val.path ==# "{s:user_jisyo_path}"') < 0
" ユーザー辞書がリストに無ければ先頭に追加する
" マークはU エンコードはutf-8
call insert(s:jisyo_list, { 'path': s:user_jisyo_path, 'encoding': 'utf-8', 'mark': 'U' })
call insert(s:jisyo_list, { 'path': s:user_jisyo_path, 'encoding': 'utf-8', 'mark': '[U]' })
endif
let s:jisyo_mark_pair = {}
let s:combined_grep_cmd = ''
Expand All @@ -52,7 +52,7 @@ function! opts#parse(opts) abort
throw $"jisyo.path can't be read {jisyo.path}"
endif

let s:jisyo_mark_pair[jisyo.path] = get(jisyo, 'mark', '') ==# '' ? '' : $'[{jisyo.mark}] '
let s:jisyo_mark_pair[jisyo.path] = get(jisyo, 'mark', '')
let encoding = get(jisyo, 'encoding', '') ==# '' ? 'auto' : jisyo.encoding
let jisyo.grep_cmd = 'rg --no-heading --with-filename --no-line-number'
\ .. $' --encoding={encoding} "^:query:" {jisyo.path}'
Expand Down

0 comments on commit b09fe5b

Please sign in to comment.