Mercurial > vim
annotate src/testdir/test_changelist.vim @ 20375:b790d00d5ccb v8.2.0743
patch 8.2.0743: can move to another buffer from a terminal in popup window
Commit: https://github.com/vim/vim/commit/5aed0ccb965dbad4b60f4c77c9c4455a9379e73c
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 12 22:02:21 2020 +0200
patch 8.2.0743: can move to another buffer from a terminal in popup window
Problem: Can move to another buffer from a terminal in popup window.
Solution: Do not allow "gf" or editing a file. (closes https://github.com/vim/vim/issues/6072)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 12 May 2020 22:15:04 +0200 |
parents | f70a3c1000bb |
children | 08940efa6b4e |
rev | line source |
---|---|
13280
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for the changelist functionality |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 " Tests for the getchangelist() function |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 func Test_getchangelist() |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 if !has("jumplist") |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 return |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 endif |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 bwipe! |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 enew |
17857
4935244c1128
patch 8.1.1925: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
13290
diff
changeset
|
11 call assert_equal([], 10->getchangelist()) |
4935244c1128
patch 8.1.1925: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
13290
diff
changeset
|
12 call assert_equal([[], 0], getchangelist()) |
13280
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call writefile(['line1', 'line2', 'line3'], 'Xfile1.txt') |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call writefile(['line1', 'line2', 'line3'], 'Xfile2.txt') |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 edit Xfile1.txt |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 exe "normal 1Goline\<C-G>u1.1" |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 exe "normal 3Goline\<C-G>u2.1" |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 exe "normal 5Goline\<C-G>u3.1" |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 normal g; |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_equal([[ |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 \ {'lnum' : 2, 'col' : 4, 'coladd' : 0}, |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 \ {'lnum' : 4, 'col' : 4, 'coladd' : 0}, |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 \ {'lnum' : 6, 'col' : 4, 'coladd' : 0}], 2], |
13290
3f3d9ed211b2
patch 8.0.1519: getchangelist() does not use argument as bufname()
Christian Brabandt <cb@256bit.org>
parents:
13280
diff
changeset
|
26 \ getchangelist('%')) |
13280
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 hide edit Xfile2.txt |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 exe "normal 1GOline\<C-G>u1.0" |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 exe "normal 2Goline\<C-G>u2.0" |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call assert_equal([[ |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 \ {'lnum' : 1, 'col' : 6, 'coladd' : 0}, |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 \ {'lnum' : 3, 'col' : 6, 'coladd' : 0}], 2], |
13290
3f3d9ed211b2
patch 8.0.1519: getchangelist() does not use argument as bufname()
Christian Brabandt <cb@256bit.org>
parents:
13280
diff
changeset
|
34 \ getchangelist('%')) |
13280
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 hide enew |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 call assert_equal([[ |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 \ {'lnum' : 2, 'col' : 4, 'coladd' : 0}, |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 \ {'lnum' : 4, 'col' : 4, 'coladd' : 0}, |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 \ {'lnum' : 6, 'col' : 4, 'coladd' : 0}], 3], getchangelist(2)) |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 call assert_equal([[ |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 \ {'lnum' : 1, 'col' : 6, 'coladd' : 0}, |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 \ {'lnum' : 3, 'col' : 6, 'coladd' : 0}], 2], getchangelist(3)) |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 bwipe! |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 call delete('Xfile1.txt') |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 call delete('Xfile2.txt') |
fbda23eb0996
patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 endfunc |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
17857
diff
changeset
|
49 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
17857
diff
changeset
|
50 " vim: shiftwidth=2 sts=2 expandtab |