plugin/gundo.vim @ 9a42f3562a99

Neovim support: line buffers shouldn't contain newlines

The result of `difflib.unified_diff()` may contains newlines at the end of its
each line. It's suppressed in original Vim, but it's illegal in Neovim.

Since there is no good way to prevent `difflib` from appending newlines to the
results, `_output_preview_text()` function should sanitize it.

Thanks @michamos

Reference:
  https://github.com/neovim/neovim/blob/a5edc5f2572d6d63f7f7a32ae6ec7bcabe1472b6/src/nvim/api/buffer.c#L215
  https://github.com/sjl/gundo.vim/pull/30#issuecomment-170064637
author Hyeon Kim <simnalamburt@gmail.com>
date Mon, 15 Dec 2014 06:29:40 +0900
parents 2a78f151df54
children (none)
" ============================================================================
" File:        gundo.vim
" Description: vim global plugin to visualize your undo tree
" Maintainer:  Steve Losh <steve@stevelosh.com>
" License:     GPLv2+ -- look it up.
" Notes:       Much of this code was thiefed from Mercurial, and the rest was
"              heavily inspired by scratch.vim and histwin.vim.
"
" ============================================================================


"{{{ Init
if !exists('g:gundo_debug') && (exists('g:gundo_disable') || exists('loaded_gundo') || &cp)"{{{
    finish
endif
let loaded_gundo = 1"}}}
"}}}

"{{{ Misc
command! -nargs=0 GundoToggle call gundo#GundoToggle()
command! -nargs=0 GundoShow call gundo#GundoShow()
command! -nargs=0 GundoHide call gundo#GundoHide()
command! -nargs=0 GundoRenderGraph call gundo#GundoRenderGraph()
"}}}