Skip to content

Commit

Permalink
fix: use isabsolutepath instead of regex compare
Browse files Browse the repository at this point in the history
  • Loading branch information
kawarimidoll committed Nov 30, 2023
1 parent 26cf960 commit 9279740
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opts.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function! opts#parse(opts) abort
" ユーザー辞書
" デフォルトは~/.cache/vim/SKK-JISYO.user
let s:user_jisyo_path = get(a:opts, 'user_jisyo_path', expand('~/.cache/vim/SKK-JISYO.user'))
if s:user_jisyo_path !~ '^/'
throw $"user_jisyo_path must be start with '/' {s:user_jisyo_path}"
if !isabsolutepath(s:user_jisyo_path)
throw $"user_jisyo_path must be absolute path {s:user_jisyo_path}"
endif
" 指定されたパスにファイルがなければ作成する
if glob(s:user_jisyo_path)->empty()
Expand Down

0 comments on commit 9279740

Please sign in to comment.