annotate src/testdir/test_gn.vim @ 11488:9473793c7bb5 v8.0.0627

patch 8.0.0627: "gn" selects only one character with 'nowrapscan' commit https://github.com/vim/vim/commit/add8dce38de65a0c64e8f54d6bdcadb45a8de2cf Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 5 19:56:04 2017 +0200 patch 8.0.0627: "gn" selects only one character with 'nowrapscan' Problem: When 'wrapscan' is off "gn" does not select the whole pattern when it's the last one in the text. (KeyboardFire) Solution: Check if the search fails. (Christian Brabandt, closes #1683)
author Christian Brabandt <cb@256bit.org>
date Mon, 05 Jun 2017 20:00:04 +0200
parents 3ee84d270ea7
children 6d3584b60170
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for gn command
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 func Test_gn_command()
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
4 set belloff=all
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
5 noautocmd new
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 " replace a single char by itsself quoted:
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 call setline('.', 'abc x def x ghi x jkl')
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 let @/='x'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 exe "norm! cgn'x'\<esc>.."
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 call assert_equal("abc 'x' def 'x' ghi 'x' jkl", getline('.'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 sil! %d_
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
12
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 " simple search match
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call setline('.', 'foobar')
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 let @/='foobar'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 exe "norm! gncsearchmatch"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 call assert_equal('searchmatch', getline('.'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
19
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 " replace a multi-line match
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call setline('.', ['', 'one', 'two'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 let @/='one\_s*two\_s'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 exe "norm! gnceins\<CR>zwei"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call assert_equal(['','eins','zwei'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
26
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 " test count argument
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call setline('.', ['', 'abcdx | abcdx | abcdx'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 let @/='[a]bcdx'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 exe "norm! 2gnd"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 call assert_equal(['','abcdx | | abcdx'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
33
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 " join lines
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 call setline('.', ['join ', 'lines'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 let @/='$'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 exe "norm! 0gnd"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 call assert_equal(['join lines'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
40
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 " zero-width match
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 call setline('.', ['', 'zero width pattern'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 let @/='\>\zs'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 exe "norm! 0gnd"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 call assert_equal(['', 'zerowidth pattern'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
47
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 " delete first and last chars
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 call setline('.', ['delete first and last chars'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 let @/='^'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 exe "norm! 0gnd$"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 let @/='\zs'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 exe "norm! gnd"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 call assert_equal(['elete first and last char'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
56
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 " using visual mode
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 call setline('.', ['', 'uniquepattern uniquepattern'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 exe "norm! /[u]niquepattern/s\<cr>vlgnd"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 call assert_equal(['', ' uniquepattern'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
62
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 " backwards search
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 call setline('.', ['my very excellent mother just served us nachos'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 let @/='mother'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 exe "norm! $cgNmongoose"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 call assert_equal(['my very excellent mongoose just served us nachos'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
69
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 " search for single char
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 call setline('.', ['','for (i=0; i<=10; i++)'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 let @/='i'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 exe "norm! cgnj"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 call assert_equal(['','for (j=0; i<=10; i++)'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
76
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 " search hex char
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 call setline('.', ['','Y'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 set noignorecase
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 let @/='\%x59'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 exe "norm! gnd"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 call assert_equal(['',''], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
84
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 " test repeating gdn
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 call setline('.', ['', '1', 'Johnny', '2', 'Johnny', '3'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 let @/='Johnny'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 exe "norm! dgn."
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 call assert_equal(['','1', '', '2', '', '3'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
91
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 " test repeating gUgn
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 call setline('.', ['', '1', 'Depp', '2', 'Depp', '3'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 let @/='Depp'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 exe "norm! gUgn."
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 call assert_equal(['', '1', 'DEPP', '2', 'DEPP', '3'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
98
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 " test using look-ahead assertions
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 call setline('.', ['a:10', '', 'a:1', '', 'a:20'])
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 let @/='a:0\@!\zs\d\+'
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 exe "norm! 2nygno\<esc>p"
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 call assert_equal(['a:10', '', 'a:1', '1', '', 'a:20'], getline(1,'$'))
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 sil! %d _
11488
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
105
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
106 " test using nowrapscan
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
107 set nowrapscan
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
108 call setline(1, 'foo bar baz')
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
109 exe "norm! /bar/e\<cr>"
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
110 exe "norm! gnd"
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
111 call assert_equal(['foo baz'], getline(1,'$'))
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
112 sil! %d_
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
113
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
114 set wrapscan&vim
9473793c7bb5 patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
115 set belloff&vim
9647
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116 endfu
847518911c0b commit https://github.com/vim/vim/commit/6835dc61aebca2b602d85a9d63c449ace58683b4
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117
9909
3ee84d270ea7 commit https://github.com/vim/vim/commit/9e4d8215d386100ab660d7d11e6620fd148b605e
Christian Brabandt <cb@256bit.org>
parents: 9647
diff changeset
118 " vim: shiftwidth=2 sts=2 expandtab