Merge pull request #30 from simnalamburt/nvim-support
Neovim support: line buffers shouldn't contain newlines
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 19 Jan 2016 14:46:47 +0000 |
parents |
1be6a45c04c8
(diff)
9a42f3562a99
(current diff)
|
children |
6577ac10e324
|
branches/tags |
v2.6.1 |
files |
autoload/gundo.py |
Changes
--- a/.hgtags Mon Dec 15 06:29:40 2014 +0900
+++ b/.hgtags Tue Jan 19 14:46:47 2016 +0000
@@ -11,3 +11,4 @@
bf31800e9784bd83c220f18fafde215abc72c4ef v2.3.0
25b74fe299c35aba1bc54c4af3febad1682b682b v2.4.0
39f23f08456425288c4a7e0ab94bec34c0b629ab v2.5.0
+5eceebd06c39b670901d1b61c87aa07b7ac57f10 v2.6.0
--- a/autoload/gundo.py Mon Dec 15 06:29:40 2014 +0900
+++ b/autoload/gundo.py Tue Jan 19 14:46:47 2016 +0000
@@ -361,7 +361,7 @@
before_name = 'Original'
before_time = ''
- after_name = node_after.n
+ after_name = str(node_after.n)
after_time = _fmt_time(node_after.time)
else:
_undo_to(node_before.n)
@@ -370,9 +370,9 @@
_undo_to(node_after.n)
after_lines = vim.current.buffer[:]
- before_name = node_before.n
+ before_name = str(node_before.n)
before_time = _fmt_time(node_before.time)
- after_name = node_after.n
+ after_name = str(node_after.n)
after_time = _fmt_time(node_after.time)
_undo_to(current)
@@ -390,9 +390,9 @@
_undo_to(node_after.n)
after_lines = vim.current.buffer[:]
- before_name = node_before.n or 'Original'
+ before_name = str(node_before.n or 'Original')
before_time = node_before.time and _fmt_time(node_before.time) or ''
- after_name = node_after.n or 'Original'
+ after_name = str(node_after.n or 'Original')
after_time = node_after.time and _fmt_time(node_after.time) or ''
_undo_to(current)
@@ -515,7 +515,8 @@
_undo_to(target_n)
vim.command('GundoRenderGraph')
- _goto_window_for_buffer(back)
+ if int(vim.eval('g:gundo_return_on_revert')):
+ _goto_window_for_buffer(back)
if int(vim.eval('g:gundo_close_on_revert')):
vim.command('GundoToggle')
--- a/autoload/gundo.vim Mon Dec 15 06:29:40 2014 +0900
+++ b/autoload/gundo.vim Tue Jan 19 14:46:47 2016 +0000
@@ -52,6 +52,9 @@
if !exists("g:gundo_playback_delay")"{{{
let g:gundo_playback_delay = 60
endif"}}}
+if !exists("g:gundo_return_on_revert")"{{{
+ let g:gundo_return_on_revert = 1
+endif"}}}
let s:has_supported_python = 0
if g:gundo_prefer_python3 && has('python3')"{{{
@@ -280,10 +283,10 @@
function! s:GundoOpen()"{{{
if !exists('g:gundo_py_loaded')
if s:has_supported_python == 2 && g:gundo_prefer_python3
- exe 'py3file ' . s:plugin_path . '/gundo.py'
+ exe 'py3file ' . escape(s:plugin_path, ' ') . '/gundo.py'
python3 initPythonModule()
else
- exe 'pyfile ' . s:plugin_path . '/gundo.py'
+ exe 'pyfile ' . escape(s:plugin_path, ' ') . '/gundo.py'
python initPythonModule()
endif
--- a/doc/gundo.txt Mon Dec 15 06:29:40 2014 +0900
+++ b/doc/gundo.txt Tue Jan 19 14:46:47 2016 +0000
@@ -21,6 +21,7 @@
gundo_tree_statusline ..... |gundo_tree_statusline|
3.10 gundo_auto_preview ........ |gundo_auto_preview|
3.11 gundo_playback_delay ...... |gundo_playback_delay|
+ 3.12 gundo_return_on_revert .... |gundo_return_on_revert|
4. License ......................... |GundoLicense|
5. Bugs ............................ |GundoBugs|
6. Contributing .................... |GundoContributing|
@@ -226,6 +227,13 @@
Default: 60
+------------------------------------------------------------------------------
+3.12 g:gundo_return_on_revert *gundo_return_on_revert*
+
+Set this to 0 to keep focus in the Gundo window after a revert.
+
+Default: 1
+
==============================================================================
4. License *GundoLicense*
@@ -249,6 +257,9 @@
==============================================================================
7. Changelog *GundoChangelog*
+v2.6.0
+ * Fix several Python-related bugs.
+ * Add g:gundo_return_on_revert option.
v2.5.0
* Fix the help window to take custom mappings into account.
* Add g:gundo_playback_delay option.
--- a/site/index.html Mon Dec 15 06:29:40 2014 +0900
+++ b/site/index.html Tue Jan 19 14:46:47 2016 +0000
@@ -101,6 +101,7 @@
<li><a href="#gundo_statusline">g:gundo_[preview/tree]_statusline</a></li>
<li><a href="#gundo_auto_preview">g:gundo_auto_preview</a></li>
<li><a href="#gundo_playback_delay">g:gundo_playback_delay</a></li>
+ <li><a href="#gundo_return_on_revert">g:gundo_return_on_revert</a></li>
</ul>
</li>
<li><a href="#license">License</a></li>
@@ -359,6 +360,14 @@
</p>
<p>Default: 60</p>
+
+ <a name="gundo_return_on_revert"></a>
+ <h2>g:gundo_return_on_revert</h2>
+
+ <p>Set this to 0 to keep focus in the Gundo window after a revert.</p>
+
+ <p>Default: 1</p>
+
</section>
<section>
<a name="license"></a>
@@ -400,6 +409,16 @@
<h1>Changelog</h1>
<ol class="changelog">
+ <li>v2.6.0
+ <ul>
+ <li>
+ Fix several Python-related bugs.
+ </li>
+ <li>
+ Add <code>g:gundo_return_on_revert</code> option.
+ </li>
+ </ul>
+ </li>
<li>v2.5.0
<ul>
<li>