-
Notifications
You must be signed in to change notification settings - Fork 112
/
operator-modifier-spec.coffee
53 lines (49 loc) · 1.49 KB
/
operator-modifier-spec.coffee
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
{getVimState, dispatch, TextData, getView, withMockPlatform} = require './spec-helper'
settings = require '../lib/settings'
describe "Operator modifier", ->
[set, ensure, editor, editorElement, vimState] = []
beforeEach ->
getVimState (state, vim) ->
vimState = state
{editor, editorElement} = vimState
{set, ensure} = vim
runs ->
jasmine.attachToDOM(editorElement)
describe "operator-modifier to force wise", ->
beforeEach ->
set
text: """
012345 789
ABCDEF EFG
"""
describe "operator-modifier-characterwise", ->
describe "when target is linewise", ->
it "operate characterwisely and exclusively", ->
set cursor: [0, 1]
ensure "d v j",
text: """
0BCDEF EFG
"""
describe "when target is characterwise", ->
it "operate inclusively for exclusive target", ->
set cursor: [0, 9]
ensure "d v b",
cursor: [0, 6]
text_: """
012345_
ABCDEF EFG
"""
it "operate exclusively for inclusive target", ->
set cursor: [0, 0]
ensure "d v e",
cursor: [0, 0]
text: """
5 789
ABCDEF EFG
"""
describe "operator-modifier-linewise", ->
it "operate linewisely for characterwise target", ->
set cursor: [0, 1]
ensure 'd V / DEF enter',
cursor: [0, 0]
text: ""