Mercurial > vim
annotate src/testdir/test_langmap.vim @ 11521:578df034735d v8.0.0643
patch 8.0.0643: when a pattern search is slow Vim becomes unusable
commit https://github.com/vim/vim/commit/fbd0b0af6800f6ff89857863d6a07ea03f09ff6c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 17 18:44:21 2017 +0200
patch 8.0.0643: when a pattern search is slow Vim becomes unusable
Problem: When 'hlsearch' is set and matching with the last search pattern
is very slow, Vim becomes unusable. Cannot quit search by
pressing CTRL-C.
Solution: When the search times out set a flag and don't try again. Check
for timeout and CTRL-C in NFA loop that adds states.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 17 Jun 2017 18:45:04 +0200 |
parents | 1a595b2a4d5e |
children | f38fcbf343ce |
rev | line source |
---|---|
7703
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " tests for 'langmap' |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
7708
1a595b2a4d5e
commit https://github.com/vim/vim/commit/09e786e7a7fc952f43e3f88ba49ab1ac6ef3b3a3
Christian Brabandt <cb@256bit.org>
parents:
7703
diff
changeset
|
3 if !has('langmap') |
1a595b2a4d5e
commit https://github.com/vim/vim/commit/09e786e7a7fc952f43e3f88ba49ab1ac6ef3b3a3
Christian Brabandt <cb@256bit.org>
parents:
7703
diff
changeset
|
4 finish |
1a595b2a4d5e
commit https://github.com/vim/vim/commit/09e786e7a7fc952f43e3f88ba49ab1ac6ef3b3a3
Christian Brabandt <cb@256bit.org>
parents:
7703
diff
changeset
|
5 endif |
1a595b2a4d5e
commit https://github.com/vim/vim/commit/09e786e7a7fc952f43e3f88ba49ab1ac6ef3b3a3
Christian Brabandt <cb@256bit.org>
parents:
7703
diff
changeset
|
6 |
7703
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 func Test_langmap() |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 new |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 set langmap=}l,^x,%v |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call setline(1, ['abc']) |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call feedkeys('gg0}^', 'tx') |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_equal('ac', getline(1)) |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 " in Replace mode |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 " need silent! to avoid a delay when entering Insert mode |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call setline(1, ['abcde']) |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 silent! call feedkeys("gg0lR%{z\<Esc>00", 'tx') |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_equal('a%{ze', getline(1)) |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 " in Select mode |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 " need silent! to avoid a delay when entering Insert mode |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 call setline(1, ['abcde']) |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 silent! call feedkeys("gg0}%}\<C-G>}^\<Esc>00", 'tx') |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call assert_equal('a}^de', getline(1)) |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 quit! |
39251e981d1f
commit https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 endfunc |