don't update the buffer if unchanged

avoids setting empty save points in vim because the buffer is updated but has
the same contents
This commit is contained in:
Samuel Walladge 2018-05-30 13:14:03 +09:30 committed by Tomas Babej
parent ffe53db9cf
commit 292fdcbb87

View file

@ -20,7 +20,10 @@ class BufferProxy(object):
def push(self):
with util.current_line_preserved():
util.get_buffer(self.buffer_number)[:] = self.data
# Only set the buffer contents if the data is changed.
# Avoids extra undo events with empty diff.
if util.get_buffer(self.buffer_number)[:] != self.data:
util.get_buffer(self.buffer_number)[:] = self.data
def __getitem__(self, index):
try: