From f9c7e1f7832b7d7d38adb30db322d674b187c05b Mon Sep 17 00:00:00 2001
From: Jerome Reybert <jreybert@gmail.com>
Date: Tue, 2 Feb 2016 15:36:11 +0100
Subject: [PATCH] plugin/magit.vim: clear undo history after each
 update_buffer() call (refs #64)

Then, user can't undo some changes in magit buffer made the backend (these changes would only be virtual).
But it can still undo some changes when he is typing.

Catch undo and make undo really undoing magit commands would be soooo cool, but seems quite difficult to implement.
---
 plugin/magit.vim | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/plugin/magit.vim b/plugin/magit.vim
index 9e2c846..57b0da5 100644
--- a/plugin/magit.vim
+++ b/plugin/magit.vim
@@ -547,6 +547,8 @@ function! magit#update_buffer()
 		call call(func.fn, func.arg)
 	endfor
 
+	call magit#utils#clear_undo()
+
 	call winrestview(l:winview)
 
 	if ( b:magit_current_commit_mode != '' )
-- 
GitLab