Add timestamps to the diff previews.
This commit is contained in:
parent
bc10779c9e
commit
b8ea3bd823
@ -653,8 +653,12 @@ def GundoRenderPreview():
|
|||||||
_goto_window_for_buffer_name('__Gundo_Preview__')
|
_goto_window_for_buffer_name('__Gundo_Preview__')
|
||||||
vim.command('setlocal modifiable')
|
vim.command('setlocal modifiable')
|
||||||
|
|
||||||
# TODO: Make some nice dates from Node.time to give to difflib.
|
def _fmt_time(t):
|
||||||
diff = list(difflib.unified_diff(before, after, node_before.n, node_after.n))
|
return time.strftime('%Y-%m-%d %I:%M:%S %p', time.localtime(float(t)))
|
||||||
|
|
||||||
|
diff = list(difflib.unified_diff(before, after, node_before.n, node_after.n,
|
||||||
|
_fmt_time(node_before.time) if node_before.n else 'n/a',
|
||||||
|
_fmt_time(node_after.time)))
|
||||||
vim.current.buffer[:] = diff
|
vim.current.buffer[:] = diff
|
||||||
|
|
||||||
vim.command('setlocal nomodifiable')
|
vim.command('setlocal nomodifiable')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user