summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_python2.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-29 21:31:09 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-29 21:31:09 +0100
commita58883b4ea0bbb813fd4dd7eb49dd6f03e3e5387 (patch)
tree5b4812b921817e5a8417c4cf62fcbcdc53cf3ec4 /src/testdir/test_python2.vim
parentd297f35eb0f6cfed47dd7ecf47df62994695a454 (diff)
patch 8.0.0265: may get ml_get error when :pydo deletes linesv8.0.0265
Problem: May get ml_get error when :pydo deletes lines or switches to another buffer. (Nikolai Pavlov, issue #1421) Solution: Check the buffer and line every time.
Diffstat (limited to 'src/testdir/test_python2.vim')
-rw-r--r--src/testdir/test_python2.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/testdir/test_python2.vim b/src/testdir/test_python2.vim
new file mode 100644
index 0000000000..fb98c1eda7
--- /dev/null
+++ b/src/testdir/test_python2.vim
@@ -0,0 +1,24 @@
+" Test for python 2 commands.
+" TODO: move tests from test87.in here.
+
+if !has('python')
+ finish
+endif
+
+func Test_pydo()
+ " Check deleting lines does not trigger ml_get error.
+ py import vim
+ new
+ call setline(1, ['one', 'two', 'three'])
+ pydo vim.command("%d_")
+ bwipe!
+
+ " Check switching to another buffer does not trigger ml_get error.
+ new
+ let wincount = winnr('$')
+ call setline(1, ['one', 'two', 'three'])
+ pydo vim.command("new")
+ call assert_equal(wincount + 1, winnr('$'))
+ bwipe!
+ bwipe!
+endfunc