aboutsummaryrefslogtreecommitdiff
path: root/test/functional/visual/meta_key_spec.lua
blob: 11f7203da00b6e05e7c906a6483345519505a794 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local command = helpers.command
local expect = helpers.expect

describe('meta-keys-in-visual-mode', function()
  before_each(function()
    clear()
  end)

  it('ALT/META', function()
    -- Unmapped ALT-chords behave as Esc+c
    insert('peaches')
    feed('viw<A-x>viw<M-x>')
    expect('peach')
    -- Mapped ALT-chord behaves as mapped.
    command('vnoremap <M-l> Ameta-l<Esc>')
    command('vnoremap <A-j> Aalt-j<Esc>')
    feed('viw<A-j>viw<M-l>')
    expect('peachalt-jmeta-l')
  end)
end)