Mercurial > vim
comparison src/testdir/test_python3.vim @ 34234:daaff6843090 v9.1.0062
patch 9.1.0062: Internal error when :luado/perldo/pydo etc delete lines
Commit: https://github.com/vim/vim/commit/e99f0688785c3d56b1ee45a28fa6ce02b850a33b
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon Jan 29 19:32:39 2024 +0100
patch 9.1.0062: Internal error when :luado/perldo/pydo etc delete lines
Problem: Internal error when :luado/perldo/pydo etc delete lines
Solution: Test that the line is still valid line number
(zeertzjq)
closes: #13931
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 29 Jan 2024 19:45:06 +0100 |
parents | d044abdf4cd3 |
children |
comparison
equal
deleted
inserted
replaced
34233:a2c41411d97b | 34234:daaff6843090 |
---|---|
86 cb.append(expr + '::' + msg) | 86 cb.append(expr + '::' + msg) |
87 EOF | 87 EOF |
88 endfunc | 88 endfunc |
89 | 89 |
90 func Test_py3do() | 90 func Test_py3do() |
91 new | |
92 | |
91 " Check deleting lines does not trigger an ml_get error. | 93 " Check deleting lines does not trigger an ml_get error. |
92 new | |
93 call setline(1, ['one', 'two', 'three']) | 94 call setline(1, ['one', 'two', 'three']) |
94 py3do vim.command("%d_") | 95 py3do vim.command("%d_") |
96 call assert_equal([''], getline(1, '$')) | |
97 | |
98 call setline(1, ['one', 'two', 'three']) | |
99 py3do vim.command("1,2d_") | |
100 call assert_equal(['three'], getline(1, '$')) | |
101 | |
102 call setline(1, ['one', 'two', 'three']) | |
103 py3do vim.command("2,3d_"); return "REPLACED" | |
104 call assert_equal(['REPLACED'], getline(1, '$')) | |
105 | |
106 call setline(1, ['one', 'two', 'three']) | |
107 2,3py3do vim.command("1,2d_"); return "REPLACED" | |
108 call assert_equal(['three'], getline(1, '$')) | |
109 | |
95 bwipe! | 110 bwipe! |
96 | 111 |
97 " Check switching to another buffer does not trigger an ml_get error. | 112 " Check switching to another buffer does not trigger an ml_get error. |
98 new | 113 new |
99 let wincount = winnr('$') | 114 let wincount = winnr('$') |