Bram Moolenaar | 913077c | 2012-03-28 19:59:04 +0200 | [diff] [blame] | 1 | Tests for curswant not changing when setting an option |
| 2 | |
| 3 | STARTTEST |
| 4 | :so small.vim |
| 5 | :/^start target options$/+1,/^end target options$/-1 yank |
| 6 | :let target_option_names = split(@0) |
| 7 | :function TestCurswant(option_name) |
| 8 | : normal! ggf8j |
| 9 | : let curswant_before = winsaveview().curswant |
| 10 | : execute 'let' '&'.a:option_name '=' '&'.a:option_name |
| 11 | : let curswant_after = winsaveview().curswant |
| 12 | : return [a:option_name, curswant_before, curswant_after] |
| 13 | :endfunction |
| 14 | : |
| 15 | :new |
| 16 | :put =['1234567890', '12345'] |
| 17 | :1 delete _ |
| 18 | :let result = [] |
| 19 | :for option_name in target_option_names |
| 20 | : call add(result, TestCurswant(option_name)) |
| 21 | :endfor |
| 22 | : |
| 23 | :new |
| 24 | :put =map(copy(result), 'join(v:val, '' '')') |
| 25 | :1 delete _ |
| 26 | :write test.out |
| 27 | : |
| 28 | :qall! |
| 29 | ENDTEST |
| 30 | |
| 31 | start target options |
| 32 | tabstop |
| 33 | timeoutlen |
| 34 | ttimeoutlen |
| 35 | end target options |