diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/sign_spec.lua | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua index bc0e2e3799..c9821ef619 100644 --- a/test/functional/ui/sign_spec.lua +++ b/test/functional/ui/sign_spec.lua @@ -115,6 +115,115 @@ describe('Signs', function() ]]) end) + it('multiple signs #9295', function() + feed('ia<cr>b<cr>c<cr><esc>') + command('set number') + command('set signcolumn=yes:2') + command('sign define pietSearch text=>> texthl=Search') + command('sign define pietError text=XX texthl=Error') + command('sign define pietWarn text=WW texthl=Warning') + command('sign place 1 line=1 name=pietSearch buffer=1') + command('sign place 2 line=1 name=pietError buffer=1') + -- Line 2 helps checking that signs in the same line are ordered by Id. + command('sign place 4 line=2 name=pietSearch buffer=1') + command('sign place 3 line=2 name=pietError buffer=1') + -- Line 3 checks that with a limit over the maximum number + -- of signs, the ones with the highest Ids are being picked, + -- and presented by their sorted Id order. + command('sign place 4 line=3 name=pietSearch buffer=1') + command('sign place 5 line=3 name=pietWarn buffer=1') + command('sign place 3 line=3 name=pietError buffer=1') + screen:expect([[ + {1:>>}XX{6: 1 }a | + XX{1:>>}{6: 2 }b | + {1:>>}WW{6: 3 }c | + {2: }{6: 4 }^ | + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + | + ]]) + -- With the default setting, we get the sign with the top id. + command('set signcolumn=yes:1') + screen:expect([[ + XX{6: 1 }a | + {1:>>}{6: 2 }b | + WW{6: 3 }c | + {2: }{6: 4 }^ | + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + | + ]]) + -- "auto:3" accommodates all the signs we defined so far. + command('set signcolumn=auto:3') + screen:expect([[ + {1:>>}XX{2: }{6: 1 }a | + XX{1:>>}{2: }{6: 2 }b | + XX{1:>>}WW{6: 3 }c | + {2: }{6: 4 }^ | + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + | + ]]) + -- Check "yes:9". + command('set signcolumn=yes:9') + screen:expect([[ + {1:>>}XX{2: }{6: 1 }a | + XX{1:>>}{2: }{6: 2 }b | + XX{1:>>}WW{2: }{6: 3 }c | + {2: }{6: 4 }^ | + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + | + ]]) + -- Check "auto:N" larger than the maximum number of signs defined in + -- a single line (same result as "auto:3"). + command('set signcolumn=auto:4') + screen:expect{grid=[[ + {1:>>}XX{2: }{6: 1 }a | + XX{1:>>}{2: }{6: 2 }b | + XX{1:>>}WW{6: 3 }c | + {2: }{6: 4 }^ | + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + {2: }{0:~ }| + | + ]]} + end) + it('can have 32bit sign IDs', function() command('sign define piet text=>> texthl=Search') command('sign place 100000 line=1 name=piet buffer=1') |