Mercurial > vim
annotate src/testdir/test_jumplist.vim @ 34873:1707288c0b15 v9.1.0303
patch 9.1.0303: filetype: some protocol buffer files not recognized
Commit: https://github.com/vim/vim/commit/e54a8e7c73bbfba0c77e928f27fb3a9bffd2e8fd
Author: Bruno BELANYI <bruno@belanyi.fr>
Date: Wed Apr 10 22:34:42 2024 +0200
patch 9.1.0303: filetype: some protocol buffer files not recognized
Problem: filetype: some protocol buffer files not recognized
Solution: Detect '*.textproto', '*.textpb', '*.txtpb' as pbtxt files
(Bruno Belanyi)
See: https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files
closes: #14463
Signed-off-by: Bruno BELANYI <bruno@belanyi.fr>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 10 Apr 2024 22:45:04 +0200 |
parents | 1f3bcb7f3bd0 |
children | 814fcbca4d8d |
rev | line source |
---|---|
13246
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for the jumplist functionality |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 " Tests for the getjumplist() function |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 func Test_getjumplist() |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 %bwipe |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 clearjumps |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 call assert_equal([[], 0], getjumplist()) |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call assert_equal([[], 0], getjumplist(1)) |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call assert_equal([[], 0], getjumplist(1, 1)) |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call assert_equal([], getjumplist(100)) |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call assert_equal([], getjumplist(1, 100)) |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 let lines = [] |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 for i in range(1, 100) |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 call add(lines, "Line " . i) |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfor |
30580
f08ed0738f7a
patch 9.0.0625: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
28388
diff
changeset
|
18 call writefile(lines, "Xtest", 'D') |
13246
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 " Jump around and create a jump list |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 edit Xtest |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 let bnr = bufnr('%') |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 normal 50% |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 normal G |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 normal gg |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 |
15788
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
27 let expected = [[ |
13246
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 \ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 \ {'lnum': 50, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
15788
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
30 \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 3] |
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
31 call assert_equal(expected, getjumplist()) |
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
32 " jumplist doesn't change in between calls |
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
33 call assert_equal(expected, getjumplist()) |
13246
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 " Traverse the jump list and verify the results |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 5 |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 exe "normal \<C-O>" |
17857
4935244c1128
patch 8.1.1925: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
15788
diff
changeset
|
38 call assert_equal(2, 1->getjumplist()[1]) |
13246
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 exe "normal 2\<C-O>" |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 call assert_equal(0, getjumplist(1, 1)[1]) |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 exe "normal 3\<C-I>" |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 call assert_equal(3, getjumplist()[1]) |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 exe "normal \<C-O>" |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 normal 20% |
15788
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
45 let expected = [[ |
13246
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 \ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 \ {'lnum': 50, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 \ {'lnum': 5, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
15788
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
49 \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 4] |
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
50 call assert_equal(expected, getjumplist()) |
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
51 " jumplist doesn't change in between calls |
c24572e66556
patch 8.1.0901: index in getjumplist() may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
13248
diff
changeset
|
52 call assert_equal(expected, getjumplist()) |
13246
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 let l = getjumplist() |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 call test_garbagecollect_now() |
13248
5958573d8a72
patch 8.0.1498: getjumplist() returns duplicate entries
Christian Brabandt <cb@256bit.org>
parents:
13246
diff
changeset
|
56 call assert_equal(4, l[1]) |
13246
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 clearjumps |
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 call test_garbagecollect_now() |
13248
5958573d8a72
patch 8.0.1498: getjumplist() returns duplicate entries
Christian Brabandt <cb@256bit.org>
parents:
13246
diff
changeset
|
59 call assert_equal(4, l[1]) |
13246
dd3b2ecf91f6
patch 8.0.1497: getting the jump list requires parsing the output of :jumps
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
17857
diff
changeset
|
61 |
28388
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
62 func Test_jumplist_invalid() |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
63 new |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
64 clearjumps |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
65 " put some randome text |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
66 put ='a' |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
67 let prev = bufnr('%') |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
68 setl nomodified bufhidden=wipe |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
69 e XXJumpListBuffer |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
70 let bnr = bufnr('%') |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
71 " 1) empty jumplist |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
72 let expected = [[ |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
73 \ {'lnum': 2, 'bufnr': prev, 'col': 0, 'coladd': 0}], 1] |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
74 call assert_equal(expected, getjumplist()) |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
75 let jumps = execute(':jumps') |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
76 call assert_equal('>', jumps[-1:]) |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
77 " now jump back |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
78 exe ":norm! \<c-o>" |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
79 let expected = [[ |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
80 \ {'lnum': 2, 'bufnr': prev, 'col': 0, 'coladd': 0}, |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
81 \ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 0] |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
82 call assert_equal(expected, getjumplist()) |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
83 let jumps = execute(':jumps') |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
84 call assert_match('> 0 2 0 -invalid-', jumps) |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
85 endfunc |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
86 |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
87 " Test for '' mark in an empty buffer |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
88 |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
89 func Test_empty_buffer() |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
90 new |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
91 insert |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
92 a |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
93 b |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
94 c |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
95 d |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
96 . |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
97 call assert_equal(1, line("''")) |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
98 bwipe! |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
99 endfunc |
320991d9812e
patch 8.2.4719: ">" marker sometimes not displayed in the jumplist
Bram Moolenaar <Bram@vim.org>
parents:
26532
diff
changeset
|
100 |
33311
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
101 " Test for 'jumpoptions' |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
102 func Test_jumpoptions() |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
103 new |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
104 call setline(1, range(1, 200)) |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
105 clearjumps |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
106 set jumpoptions=stack |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
107 |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
108 " Jump around to add some locations to the jump list. |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
109 normal 10G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
110 normal 20G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
111 normal 30G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
112 normal 40G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
113 normal 50G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
114 let bnr = bufnr() |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
115 |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
116 " discards the tail when navigating from the middle |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
117 exe "normal \<C-O>\<C-O>" |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
118 call assert_equal([ |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
119 \ [{'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
120 \ {'lnum': 10, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
121 \ {'lnum': 20, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
122 \ {'lnum': 30, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
123 \ {'lnum': 40, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
124 \ {'lnum': 50, 'bufnr': bnr, 'col': 0, 'coladd': 0} |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
125 \ ], 3], getjumplist()) |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
126 |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
127 " new jump location is added immediately after the last one |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
128 normal 90G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
129 call assert_equal([ |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
130 \ [{'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
131 \ {'lnum': 10, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
132 \ {'lnum': 20, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
133 \ {'lnum': 30, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
134 \ ], 4], getjumplist()) |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
135 |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
136 " does not add the same location twice adjacently |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
137 normal 60G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
138 normal 60G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
139 call assert_equal([ |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
140 \ [{'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
141 \ {'lnum': 10, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
142 \ {'lnum': 20, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
143 \ {'lnum': 30, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
144 \ {'lnum': 90, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
145 \ {'lnum': 60, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
146 \ ], 6], getjumplist()) |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
147 |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
148 " does add the same location twice non adjacently |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
149 normal 10G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
150 normal 20G |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
151 call assert_equal([ |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
152 \ [{'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
153 \ {'lnum': 10, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
154 \ {'lnum': 20, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
155 \ {'lnum': 30, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
156 \ {'lnum': 90, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
157 \ {'lnum': 60, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
158 \ {'lnum': 10, 'bufnr': bnr, 'col': 0, 'coladd': 0}, |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
159 \ ], 7], getjumplist()) |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
160 |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
161 set jumpoptions& |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
162 %bw! |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
163 endfunc |
1f3bcb7f3bd0
patch 9.0.1921: not possible to use the jumplist like a stack
Christian Brabandt <cb@256bit.org>
parents:
30580
diff
changeset
|
164 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
17857
diff
changeset
|
165 " vim: shiftwidth=2 sts=2 expandtab |