Skip to content

Commit

Permalink
Merge pull request #73 from alker0/tmp_buf_clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
alker0 authored Apr 1, 2024
2 parents a35b426 + ea748af commit 2c78807
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions autoload/chezmoi/filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,18 @@ function! s:run_default_detect(detect_target) abort
let evignore_save = &eventignore
let bufhidden_save = &bufhidden
let l:cpo_save = &cpo
let l:clipboard_save = &clipboard
let l:reg_content_save = getreg('"')
let l:reg_type_save = getregtype('"')

let bufnr_org = bufnr()

try
set eventignore=all

" Disable clipboard
set clipboard=

" Enable to move to other buffer.
set bufhidden=hide

Expand Down Expand Up @@ -214,6 +220,8 @@ function! s:run_default_detect(detect_target) abort
let &eventignore = evignore_save
let &bufhidden = bufhidden_save
let &cpo = l:cpo_save
call setreg('""', l:reg_content_save, l:reg_type_save)
let &clipboard = l:clipboard_save
endtry
else
execute 'doau filetypedetect BufRead ' . fnameescape(a:detect_target)
Expand Down

0 comments on commit 2c78807

Please sign in to comment.