Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep clipboard contents #73

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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