From 5989eb882e8be27edef5c0738580917d0179626b Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Fri, 14 Jun 2019 16:56:28 +0100 Subject: [PATCH] Do not overwrite registers when undoing hunks. Fixes #629. --- autoload/gitgutter/hunk.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/gitgutter/hunk.vim b/autoload/gitgutter/hunk.vim index e24dc20..6537a8d 100644 --- a/autoload/gitgutter/hunk.vim +++ b/autoload/gitgutter/hunk.vim @@ -240,10 +240,10 @@ function! s:undo(hunk_diff) if removed_only call append(lnum, lines) elseif added_only - execute lnum .','. (lnum+len(lines)-1) .'d' + execute lnum .','. (lnum+len(lines)-1) .'d _' else call append(lnum-1, lines[0:hunk[1]]) - execute (lnum+hunk[1]) .','. (lnum+hunk[1]+hunk[3]) .'d' + execute (lnum+hunk[1]) .','. (lnum+hunk[1]+hunk[3]) .'d _' endif endfunction