Skip to content

Commit

Permalink
fix: option set was breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kuuote committed Jun 7, 2024
1 parent 2c40357 commit 2225a13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions autoload/skkeleton.vim
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ function! skkeleton#disable()
if g:skkeleton#enabled
doautocmd <nomodeline> User skkeleton-disable-pre
call skkeleton#internal#map#restore()
call skkeleton#internal#option#restore()
let g:skkeleton#mode = ''
doautocmd <nomodeline> User skkeleton-mode-changed
doautocmd <nomodeline> User skkeleton-disable-post
Expand Down
7 changes: 5 additions & 2 deletions autoload/skkeleton/internal/option.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function s:ensure(dict, key, value)
endfunction

function skkeleton#internal#option#save_and_set()
" cmdline関係ないオプションだけなので辞書登録時はスキップ
if mode() !=# 'c'
" cmdline関係ないオプションだけなのでcmdlineでは飛ばす
if mode() ==# 'c'
return
endif
call s:ensure(s:textwidth, bufnr(), &l:textwidth)
Expand All @@ -19,6 +19,9 @@ function skkeleton#internal#option#save_and_set()
endfunction

function skkeleton#internal#option#restore()
if mode() ==# 'c'
return
endif
let bufnr = bufnr()
let winid = win_getid()
if has_key(s:textwidth, bufnr)
Expand Down

0 comments on commit 2225a13

Please sign in to comment.