Mercurial > vim
annotate src/testdir/test_sleep.vim @ 32788:80152cf7ce63 v9.0.1710
patch 9.0.1710: scrolloff options work slightly different
Commit: https://github.com/vim/vim/commit/4a8eb6e7a9df10f79bf95301ced012f0d6a13088
Author: Christian Brabandt <cb@256bit.org>
Date: Sun Aug 13 19:43:42 2023 +0200
patch 9.0.1710: scrolloff options work slightly different
Problem: sidescrolloff and scrolloff options work slightly
different than other global-local options
Solution: Make it behave consistent for all global-local options
It was noticed, that sidescrolloff and scrolloff options behave
differently in comparison to other global-local window options like
'listchars'
So make those two behave like other global-local options. Also add some
extra documentation for a few special local-window options.
Add a few tests to make sure all global-local window options behave
similar
closes: #12956
closes: #12643
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 13 Aug 2023 20:00:04 +0200 |
parents | 98774a275d6d |
children |
rev | line source |
---|---|
23648
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Test for sleep and sleep! commands |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 func! s:get_time_ms() |
32160
98774a275d6d
patch 9.0.1411: accuracy of profiling is not optimal
Bram Moolenaar <Bram@vim.org>
parents:
24101
diff
changeset
|
4 return float2nr(reltimefloat(reltime()) * 1000) |
23648
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 endfunc |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 func! s:assert_takes_longer(cmd, time_ms) |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 let start = s:get_time_ms() |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 execute a:cmd |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 let end = s:get_time_ms() |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 call assert_true(end - start >=# a:time_ms) |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 endfun |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 func! Test_sleep_bang() |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 call s:assert_takes_longer('sleep 50m', 50) |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 call s:assert_takes_longer('sleep! 50m', 50) |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 call s:assert_takes_longer('sl 50m', 50) |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 call s:assert_takes_longer('sl! 50m', 50) |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 call s:assert_takes_longer('1sleep', 1000) |
24101
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23648
diff
changeset
|
20 call s:assert_takes_longer('normal 1gs', 1000) |
23648
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 endfunc |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 |
b7d3c79075c5
patch 8.2.2366: when using ":sleep" the cursor is always displayed
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 " vim: shiftwidth=2 sts=2 expandtab |