1 helpers = require './spec-helper'
3 describe "TextObjects", ->
4 [editor, editorElement, vimState] = []
7 vimMode = atom.packages.loadPackage('vim-mode')
8 vimMode.activateResources()
10 helpers.getEditorElement (element) ->
11 editorElement = element
12 editor = editorElement.getModel()
13 vimState = editorElement.vimState
14 vimState.activateNormalMode()
15 vimState.resetNormalMode()
17 keydown = (key, options={}) ->
18 options.element ?= editorElement
19 helpers.keydown(key, options)
21 describe "Text Object commands in normal mode not preceded by an operator", ->
23 vimState.activateNormalMode()
25 it "selects the appropriate text", ->
26 editor.setText("<html> text </html>")
27 editor.setCursorScreenPosition([0, 7])
28 # Users could dispatch it via the command palette
29 atom.commands.dispatch(editorElement, "vim-mode:select-inside-tags")
30 expect(editor.getSelectedScreenRange()).toEqual [[0, 6], [0, 12]]
32 describe "the 'iw' text object", ->
34 editor.setText("12345 abcde ABCDE")
35 editor.setCursorScreenPosition([0, 9])
37 it "applies operators inside the current word in operator-pending mode", ->
42 expect(editor.getText()).toBe "12345 ABCDE"
43 expect(editor.getCursorScreenPosition()).toEqual [0, 6]
44 expect(vimState.getRegister('"').text).toBe "abcde"
45 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
46 expect(editorElement.classList.contains('normal-mode')).toBe(true)
48 it "selects inside the current word in visual mode", ->
53 expect(editor.getSelectedScreenRange()).toEqual [[0, 6], [0, 11]]
55 it "expands an existing selection in visual mode", ->
63 expect(editor.getSelectedScreenRange()).toEqual [[0, 9], [0, 17]]
65 it "works with multiple cursors", ->
66 editor.addCursorAtBufferPosition([0, 1])
70 expect(editor.getSelectedBufferRanges()).toEqual [
75 describe "the 'iW' text object", ->
77 editor.setText("12(45 ab'de ABCDE")
78 editor.setCursorScreenPosition([0, 9])
80 it "applies operators inside the current whole word in operator-pending mode", ->
83 keydown('W', shift: true)
85 expect(editor.getText()).toBe "12(45 ABCDE"
86 expect(editor.getCursorScreenPosition()).toEqual [0, 6]
87 expect(vimState.getRegister('"').text).toBe "ab'de"
88 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
89 expect(editorElement.classList.contains('normal-mode')).toBe(true)
91 it "selects inside the current whole word in visual mode", ->
94 keydown('W', shift: true)
96 expect(editor.getSelectedScreenRange()).toEqual [[0, 6], [0, 11]]
98 it "expands an existing selection in visual mode", ->
104 keydown('W', shift: true)
106 expect(editor.getSelectedScreenRange()).toEqual [[0, 9], [0, 17]]
108 describe "the 'i(' text object", ->
110 editor.setText("( something in here and in (here) )")
111 editor.setCursorScreenPosition([0, 9])
113 it "applies operators inside the current word in operator-pending mode", ->
117 expect(editor.getText()).toBe "()"
118 expect(editor.getCursorScreenPosition()).toEqual [0, 1]
119 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
120 expect(editorElement.classList.contains('normal-mode')).toBe(true)
122 it "applies operators inside the current word in operator-pending mode (second test)", ->
123 editor.setCursorScreenPosition([0, 29])
127 expect(editor.getText()).toBe "( something in here and in () )"
128 expect(editor.getCursorScreenPosition()).toEqual [0, 28]
129 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
130 expect(editorElement.classList.contains('normal-mode')).toBe(true)
132 it "works with multiple cursors", ->
133 editor.setText("( a b ) cde ( f g h ) ijk")
134 editor.setCursorBufferPosition([0, 2])
135 editor.addCursorAtBufferPosition([0, 18])
141 expect(editor.getSelectedBufferRanges()).toEqual [
146 it "expands an existing selection in visual mode", ->
147 editor.setCursorScreenPosition([0, 25])
156 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 32]]
158 describe "the 'i{' text object", ->
160 editor.setText("{ something in here and in {here} }")
161 editor.setCursorScreenPosition([0, 9])
163 it "applies operators inside the current word in operator-pending mode", ->
167 expect(editor.getText()).toBe "{}"
168 expect(editor.getCursorScreenPosition()).toEqual [0, 1]
169 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
170 expect(editorElement.classList.contains('normal-mode')).toBe(true)
172 it "applies operators inside the current word in operator-pending mode (second test)", ->
173 editor.setCursorScreenPosition([0, 29])
177 expect(editor.getText()).toBe "{ something in here and in {} }"
178 expect(editor.getCursorScreenPosition()).toEqual [0, 28]
179 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
180 expect(editorElement.classList.contains('normal-mode')).toBe(true)
182 it "expands an existing selection in visual mode", ->
183 editor.setCursorScreenPosition([0, 25])
192 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 32]]
194 describe "the 'i<' text object", ->
196 editor.setText("< something in here and in <here> >")
197 editor.setCursorScreenPosition([0, 9])
199 it "applies operators inside the current word in operator-pending mode", ->
203 expect(editor.getText()).toBe "<>"
204 expect(editor.getCursorScreenPosition()).toEqual [0, 1]
205 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
206 expect(editorElement.classList.contains('normal-mode')).toBe(true)
208 it "applies operators inside the current word in operator-pending mode (second test)", ->
209 editor.setCursorScreenPosition([0, 29])
213 expect(editor.getText()).toBe "< something in here and in <> >"
214 expect(editor.getCursorScreenPosition()).toEqual [0, 28]
215 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
216 expect(editorElement.classList.contains('normal-mode')).toBe(true)
218 it "expands an existing selection in visual mode", ->
219 editor.setCursorScreenPosition([0, 25])
228 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 32]]
230 describe "the 'it' text object", ->
232 editor.setText("<something>here</something><again>")
233 editor.setCursorScreenPosition([0, 5])
235 it "applies only if in the value of a tag", ->
239 expect(editor.getText()).toBe "<something>here</something><again>"
240 expect(editor.getCursorScreenPosition()).toEqual [0, 5]
241 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
242 expect(editorElement.classList.contains('normal-mode')).toBe(true)
244 it "applies operators inside the current word in operator-pending mode", ->
245 editor.setCursorScreenPosition([0, 13])
249 expect(editor.getText()).toBe "<something></something><again>"
250 expect(editor.getCursorScreenPosition()).toEqual [0, 11]
251 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
252 expect(editorElement.classList.contains('normal-mode')).toBe(true)
254 it "expands an existing selection in visual mode", ->
255 editor.setCursorScreenPosition([0, 7])
262 expect(editor.getSelectedScreenRange()).toEqual [[0, 7], [0, 15]]
264 describe "the 'ip' text object", ->
266 editor.setText("\nParagraph-1\nParagraph-1\nParagraph-1\n\n")
267 editor.setCursorBufferPosition([2, 2])
269 it "applies operators inside the current paragraph in operator-pending mode", ->
274 expect(editor.getText()).toBe "\nParagraph-1\nParagraph-1\nParagraph-1\n\n"
275 expect(editor.getCursorScreenPosition()).toEqual [1, 0]
276 expect(vimState.getRegister('"').text).toBe "Paragraph-1\nParagraph-1\nParagraph-1\n"
277 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
278 expect(editorElement.classList.contains('normal-mode')).toBe(true)
280 it "selects inside the current paragraph in visual mode", ->
285 expect(editor.getSelectedScreenRange()).toEqual [[1, 0], [4, 0]]
287 it "selects between paragraphs in visual mode if invoked on a empty line", ->
288 editor.setText("text\n\n\n\ntext\n")
289 editor.setCursorBufferPosition([1, 0])
295 expect(editor.getSelectedScreenRange()).toEqual [[1, 0], [4, 0]]
297 it "selects all the lines", ->
298 editor.setText("text\ntext\ntext\n")
299 editor.setCursorBufferPosition([0, 0])
305 expect(editor.getSelectedScreenRange()).toEqual [[0, 0], [3, 0]]
307 it "expands an existing selection in visual mode", ->
308 editor.setText("\nParagraph-1\nParagraph-1\nParagraph-1\n\n\nParagraph-2\nParagraph-2\nParagraph-2\n")
309 editor.setCursorBufferPosition([2, 2])
321 expect(editor.getSelectedScreenRange()).toEqual [[1, 0], [9, 0]]
323 describe "the 'ap' text object", ->
325 editor.setText("text\n\nParagraph-1\nParagraph-1\nParagraph-1\n\n\nmoretext")
326 editor.setCursorScreenPosition([3, 2])
328 it "applies operators around the current paragraph in operator-pending mode", ->
333 expect(editor.getText()).toBe "text\n\nParagraph-1\nParagraph-1\nParagraph-1\n\n\nmoretext"
334 expect(editor.getCursorScreenPosition()).toEqual [2, 0]
335 expect(vimState.getRegister('"').text).toBe "Paragraph-1\nParagraph-1\nParagraph-1\n\n\n"
336 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
337 expect(editorElement.classList.contains('normal-mode')).toBe(true)
339 it "selects around the current paragraph in visual mode", ->
344 expect(editor.getSelectedScreenRange()).toEqual [[2, 0], [7, 0]]
346 it "applies operators around the next paragraph in operator-pending mode when started from a blank/only-whitespace line", ->
347 editor.setText("text\n\n\n\nParagraph-1\nParagraph-1\nParagraph-1\n\n\nmoretext")
348 editor.setCursorBufferPosition([1, 0])
354 expect(editor.getText()).toBe "text\n\n\n\nParagraph-1\nParagraph-1\nParagraph-1\n\n\nmoretext"
355 expect(editor.getCursorScreenPosition()).toEqual [1, 0]
356 expect(vimState.getRegister('"').text).toBe "\n\n\nParagraph-1\nParagraph-1\nParagraph-1\n"
357 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
358 expect(editorElement.classList.contains('normal-mode')).toBe(true)
360 it "selects around the next paragraph in visual mode when started from a blank/only-whitespace line", ->
361 editor.setText("text\n\n\n\nparagraph-1\nparagraph-1\nparagraph-1\n\n\nmoretext")
362 editor.setCursorBufferPosition([1, 0])
368 expect(editor.getSelectedScreenRange()).toEqual [[1, 0], [7, 0]]
370 it "expands an existing selection in visual mode", ->
371 editor.setText("text\n\n\n\nparagraph-1\nparagraph-1\nparagraph-1\n\n\n\nparagraph-2\nparagraph-2\nparagraph-2\n\n\nmoretext")
372 editor.setCursorBufferPosition([5, 0])
384 expect(editor.getSelectedScreenRange()).toEqual [[4, 0], [13, 0]]
386 describe "the 'i[' text object", ->
388 editor.setText("[ something in here and in [here] ]")
389 editor.setCursorScreenPosition([0, 9])
391 it "applies operators inside the current word in operator-pending mode", ->
395 expect(editor.getText()).toBe "[]"
396 expect(editor.getCursorScreenPosition()).toEqual [0, 1]
397 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
398 expect(editorElement.classList.contains('normal-mode')).toBe(true)
400 it "applies operators inside the current word in operator-pending mode (second test)", ->
401 editor.setCursorScreenPosition([0, 29])
405 expect(editor.getText()).toBe "[ something in here and in [] ]"
406 expect(editor.getCursorScreenPosition()).toEqual [0, 28]
407 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
408 expect(editorElement.classList.contains('normal-mode')).toBe(true)
410 it "expands an existing selection in visual mode", ->
411 editor.setCursorScreenPosition([0, 25])
420 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 32]]
422 describe "the 'i\'' text object", ->
424 editor.setText("' something in here and in 'here' ' and over here")
425 editor.setCursorScreenPosition([0, 9])
427 it "applies operators inside the current string in operator-pending mode", ->
431 expect(editor.getText()).toBe "''here' ' and over here"
432 expect(editor.getCursorScreenPosition()).toEqual [0, 1]
433 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
434 expect(editorElement.classList.contains('normal-mode')).toBe(true)
436 it "applies operators inside the next string in operator-pending mode (if not in a string)", ->
437 editor.setCursorScreenPosition([0, 29])
441 expect(editor.getText()).toBe "' something in here and in 'here'' and over here"
442 expect(editor.getCursorScreenPosition()).toEqual [0, 33]
443 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
444 expect(editorElement.classList.contains('normal-mode')).toBe(true)
446 it "makes no change if past the last string on a line", ->
447 editor.setCursorScreenPosition([0, 39])
451 expect(editor.getText()).toBe "' something in here and in 'here' ' and over here"
452 expect(editor.getCursorScreenPosition()).toEqual [0, 39]
453 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
454 expect(editorElement.classList.contains('normal-mode')).toBe(true)
456 it "expands an existing selection in visual mode", ->
457 editor.setCursorScreenPosition([0, 25])
466 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 34]]
468 describe "the 'i\"' text object", ->
470 editor.setText("\" something in here and in \"here\" \" and over here")
471 editor.setCursorScreenPosition([0, 9])
473 it "applies operators inside the current string in operator-pending mode", ->
477 expect(editor.getText()).toBe "\"\"here\" \" and over here"
478 expect(editor.getCursorScreenPosition()).toEqual [0, 1]
479 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
480 expect(editorElement.classList.contains('normal-mode')).toBe(true)
482 it "applies operators inside the next string in operator-pending mode (if not in a string)", ->
483 editor.setCursorScreenPosition([0, 29])
487 expect(editor.getText()).toBe "\" something in here and in \"here\"\" and over here"
488 expect(editor.getCursorScreenPosition()).toEqual [0, 33]
489 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
490 expect(editorElement.classList.contains('normal-mode')).toBe(true)
492 it "makes no change if past the last string on a line", ->
493 editor.setCursorScreenPosition([0, 39])
497 expect(editor.getText()).toBe "\" something in here and in \"here\" \" and over here"
498 expect(editor.getCursorScreenPosition()).toEqual [0, 39]
499 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
501 it "expands an existing selection in visual mode", ->
502 editor.setCursorScreenPosition([0, 25])
511 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 34]]
513 describe "the 'aw' text object", ->
515 editor.setText("12345 abcde ABCDE")
516 editor.setCursorScreenPosition([0, 9])
518 it "applies operators from the start of the current word to the start of the next word in operator-pending mode", ->
523 expect(editor.getText()).toBe "12345 ABCDE"
524 expect(editor.getCursorScreenPosition()).toEqual [0, 6]
525 expect(vimState.getRegister('"').text).toBe "abcde "
526 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
527 expect(editorElement.classList.contains('normal-mode')).toBe(true)
529 it "selects from the start of the current word to the start of the next word in visual mode", ->
534 expect(editor.getSelectedScreenRange()).toEqual [[0, 6], [0, 12]]
536 it "expands an existing selection in visual mode", ->
537 editor.setCursorScreenPosition([0, 2])
545 expect(editor.getSelectedScreenRange()).toEqual [[0, 2], [0, 12]]
547 it "doesn't span newlines", ->
548 editor.setText("12345\nabcde ABCDE")
549 editor.setCursorBufferPosition([0, 3])
555 expect(editor.getSelectedBufferRanges()).toEqual [[[0, 0], [0, 5]]]
557 it "doesn't span special characters", ->
558 editor.setText("1(345\nabcde ABCDE")
559 editor.setCursorBufferPosition([0, 3])
565 expect(editor.getSelectedBufferRanges()).toEqual [[[0, 2], [0, 5]]]
567 describe "the 'aW' text object", ->
569 editor.setText("12(45 ab'de ABCDE")
570 editor.setCursorScreenPosition([0, 9])
572 it "applies operators from the start of the current whole word to the start of the next whole word in operator-pending mode", ->
575 keydown('W', shift: true)
577 expect(editor.getText()).toBe "12(45 ABCDE"
578 expect(editor.getCursorScreenPosition()).toEqual [0, 6]
579 expect(vimState.getRegister('"').text).toBe "ab'de "
580 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
581 expect(editorElement.classList.contains('normal-mode')).toBe(true)
583 it "selects from the start of the current whole word to the start of the next whole word in visual mode", ->
586 keydown('W', shift: true)
588 expect(editor.getSelectedScreenRange()).toEqual [[0, 6], [0, 12]]
590 it "expands an existing selection in visual mode", ->
591 editor.setCursorScreenPosition([0, 2])
597 keydown('W', shift: true)
599 expect(editor.getSelectedScreenRange()).toEqual [[0, 2], [0, 12]]
601 it "doesn't span newlines", ->
602 editor.setText("12(45\nab'de ABCDE")
603 editor.setCursorBufferPosition([0, 4])
607 keydown('W', shift: true)
609 expect(editor.getSelectedBufferRanges()).toEqual [[[0, 0], [0, 5]]]
611 describe "the 'a(' text object", ->
613 editor.setText("( something in here and in (here) )")
614 editor.setCursorScreenPosition([0, 9])
616 it "applies operators around the current parentheses in operator-pending mode", ->
620 expect(editor.getText()).toBe ""
621 expect(editor.getCursorScreenPosition()).toEqual [0, 0]
622 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
623 expect(editorElement.classList.contains('normal-mode')).toBe(true)
625 it "applies operators around the current parentheses in operator-pending mode (second test)", ->
626 editor.setCursorScreenPosition([0, 29])
630 expect(editor.getText()).toBe "( something in here and in )"
631 expect(editor.getCursorScreenPosition()).toEqual [0, 27]
632 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
633 expect(editorElement.classList.contains('normal-mode')).toBe(true)
635 it "expands an existing selection in visual mode", ->
636 editor.setCursorScreenPosition([0, 25])
645 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 33]]
647 describe "the 'a{' text object", ->
649 editor.setText("{ something in here and in {here} }")
650 editor.setCursorScreenPosition([0, 9])
652 it "applies operators around the current curly brackets in operator-pending mode", ->
656 expect(editor.getText()).toBe ""
657 expect(editor.getCursorScreenPosition()).toEqual [0, 0]
658 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
659 expect(editorElement.classList.contains('normal-mode')).toBe(true)
661 it "applies operators around the current curly brackets in operator-pending mode (second test)", ->
662 editor.setCursorScreenPosition([0, 29])
666 expect(editor.getText()).toBe "{ something in here and in }"
667 expect(editor.getCursorScreenPosition()).toEqual [0, 27]
668 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
669 expect(editorElement.classList.contains('normal-mode')).toBe(true)
671 it "expands an existing selection in visual mode", ->
672 editor.setCursorScreenPosition([0, 25])
681 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 33]]
683 describe "the 'a<' text object", ->
685 editor.setText("< something in here and in <here> >")
686 editor.setCursorScreenPosition([0, 9])
688 it "applies operators around the current angle brackets in operator-pending mode", ->
692 expect(editor.getText()).toBe ""
693 expect(editor.getCursorScreenPosition()).toEqual [0, 0]
694 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
695 expect(editorElement.classList.contains('normal-mode')).toBe(true)
697 it "applies operators around the current angle brackets in operator-pending mode (second test)", ->
698 editor.setCursorScreenPosition([0, 29])
702 expect(editor.getText()).toBe "< something in here and in >"
703 expect(editor.getCursorScreenPosition()).toEqual [0, 27]
704 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
705 expect(editorElement.classList.contains('normal-mode')).toBe(true)
707 it "expands an existing selection in visual mode", ->
708 editor.setCursorScreenPosition([0, 25])
717 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 33]]
719 describe "the 'a[' text object", ->
721 editor.setText("[ something in here and in [here] ]")
722 editor.setCursorScreenPosition([0, 9])
724 it "applies operators around the current square brackets in operator-pending mode", ->
728 expect(editor.getText()).toBe ""
729 expect(editor.getCursorScreenPosition()).toEqual [0, 0]
730 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
731 expect(editorElement.classList.contains('normal-mode')).toBe(true)
733 it "applies operators around the current square brackets in operator-pending mode (second test)", ->
734 editor.setCursorScreenPosition([0, 29])
738 expect(editor.getText()).toBe "[ something in here and in ]"
739 expect(editor.getCursorScreenPosition()).toEqual [0, 27]
740 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
741 expect(editorElement.classList.contains('normal-mode')).toBe(true)
743 it "expands an existing selection in visual mode", ->
744 editor.setCursorScreenPosition([0, 25])
753 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 33]]
755 describe "the 'a\'' text object", ->
757 editor.setText("' something in here and in 'here' '")
758 editor.setCursorScreenPosition([0, 9])
760 it "applies operators around the current single quotes in operator-pending mode", ->
764 expect(editor.getText()).toBe "here' '"
765 expect(editor.getCursorScreenPosition()).toEqual [0, 0]
766 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
767 expect(editorElement.classList.contains('normal-mode')).toBe(true)
769 it "applies operators around the current single quotes in operator-pending mode (second test)", ->
770 editor.setCursorScreenPosition([0, 29])
774 expect(editor.getText()).toBe "' something in here and in 'here"
775 expect(editor.getCursorScreenPosition()).toEqual [0, 31]
776 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
777 expect(editorElement.classList.contains('normal-mode')).toBe(true)
779 it "expands an existing selection in visual mode", ->
780 editor.setCursorScreenPosition([0, 25])
789 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 35]]
791 describe "the 'a\"' text object", ->
793 editor.setText("\" something in here and in \"here\" \"")
794 editor.setCursorScreenPosition([0, 9])
796 it "applies operators around the current double quotes in operator-pending mode", ->
800 expect(editor.getText()).toBe 'here" "'
801 expect(editor.getCursorScreenPosition()).toEqual [0, 0]
802 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
803 expect(editorElement.classList.contains('normal-mode')).toBe(true)
805 it "applies operators around the current double quotes in operator-pending mode (second test)", ->
806 editor.setCursorScreenPosition([0, 29])
810 expect(editor.getText()).toBe "\" something in here and in \"here"
811 expect(editor.getCursorScreenPosition()).toEqual [0, 31]
812 expect(editorElement.classList.contains('operator-pending-mode')).toBe(false)
813 expect(editorElement.classList.contains('normal-mode')).toBe(true)
815 it "expands an existing selection in visual mode", ->
816 editor.setCursorScreenPosition([0, 25])
825 expect(editor.getSelectedScreenRange()).toEqual [[0, 25], [0, 35]]