Mercurial > vim
annotate src/testdir/test_move.vim @ 28817:1ad71fcbf546 v8.2.4932
patch 8.2.4932: not easy to filter the output of maplist()
Commit: https://github.com/vim/vim/commit/d8f5f766219273a8579947cc80b92580b6988a4b
Author: Ernie Rael <errael@raelity.com>
Date: Tue May 10 17:50:39 2022 +0100
patch 8.2.4932: not easy to filter the output of maplist()
Problem: Not easy to filter the output of maplist().
Solution: Add mode_bits to the dictionary. (Ernie Rael, closes https://github.com/vim/vim/issues/10356)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 10 May 2022 19:00:04 +0200 |
parents | ff21e2962490 |
children | 984969b81d63 |
rev | line source |
---|---|
15010
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Test the ":move" command. |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 func Test_move() |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 enew! |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 call append(0, ['line 1', 'line 2', 'line 3']) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 g /^$/ delete _ |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 set nomodified |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 move . |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3)) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 call assert_false(&modified) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 1,2move 0 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3)) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 call assert_false(&modified) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 1,3move 3 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3)) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 call assert_false(&modified) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 1move 2 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 call assert_equal(['line 2', 'line 1', 'line 3'], getline(1, 3)) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 call assert_true(&modified) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 set nomodified |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 3move 0 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 call assert_equal(['line 3', 'line 2', 'line 1'], getline(1, 3)) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 call assert_true(&modified) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 set nomodified |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 2,3move 0 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 call assert_equal(['line 2', 'line 1', 'line 3'], getline(1, 3)) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 call assert_true(&modified) |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 set nomodified |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 |
22087
ff21e2962490
patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
36 call assert_fails('1,2move 1', 'E134:') |
ff21e2962490
patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
37 call assert_fails('2,3move 2', 'E134:') |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
15010
diff
changeset
|
38 call assert_fails("move -100", 'E16:') |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
15010
diff
changeset
|
39 call assert_fails("move +100", 'E16:') |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
15010
diff
changeset
|
40 call assert_fails('move', 'E16:') |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19231
diff
changeset
|
41 call assert_fails("move 'r", 'E20:') |
15010
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 %bwipeout! |
e3910b9827d0
patch 8.1.0516: :move command marks buffer modified when nothing changed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 endfunc |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
15010
diff
changeset
|
45 |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
15010
diff
changeset
|
46 " vim: shiftwidth=2 sts=2 expandtab |