Skip to content

Use bufhidden=wipe for Scratch diff buffers #911

@Voltron369

Description

@Voltron369

Prevents [NoName] Scratch buffers from accumulating:

proposed code change:

M autoload/gitgutter.vim
@@ -259,6 +259,8 @@ function! gitgutter#difforig()
 
   vertical new
   set buftype=nofile
+ if v:version >= 800
+     setlocal bufhidden=wipe
+ endif
+ setlocal noswapfile
   let &filetype = filetype
 
   if g:gitgutter_diff_relative_to ==# 'index'
@@ -273,6 +275,7 @@ function! gitgutter#difforig()
 
   0d_
   diffthis
+  setlocal nomodifiable
   wincmd p
   diffthis
 endfunction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions