aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/tabline_spec.lua
blob: d858f137c51da13098909c4703fb0c43a7037208 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local exec = helpers.exec
local feed = helpers.feed

before_each(clear)

describe('tabline', function()
  local screen

  before_each(function()
    screen = Screen.new(50, 7)
    screen:attach()
  end)

  -- oldtest: Test_tabline_showcmd()
  it('showcmdloc=tabline works', function()
    screen:set_default_attr_ids({
      [0] = {bold = true, foreground = Screen.colors.Blue},  -- NonText
      [1] = {background = Screen.colors.LightGrey},  -- Visual
      [2] = {bold = true},  -- MoreMsg, TabLineSel
      [3] = {reverse = true},  -- TabLineFill
      [4] = {background = Screen.colors.LightGrey, underline = true},  -- TabLine
    })
    exec([[
      set showcmd
      set showtabline=2
      set showcmdloc=tabline
      call setline(1, ['a', 'b', 'c'])
    ]])
    feed('<C-V>Gl')
    screen:expect([[
      {2: + [No Name] }{3:                           }{4:3x2}{3:       }|
      {1:a}                                                 |
      {1:b}                                                 |
      {1:c}^                                                 |
      {0:~                                                 }|
      {0:~                                                 }|
      {2:-- VISUAL BLOCK --}                                |
    ]])
    feed('<Esc>1234')
    screen:expect([[
      {2: + [No Name] }{3:                           }{4:1234}{3:      }|
      a                                                 |
      b                                                 |
      ^c                                                 |
      {0:~                                                 }|
      {0:~                                                 }|
                                                        |
    ]])
  end)
end)