Skip to content

Commit 88c7f97

Browse files
committed
add specs for expected cursor position after operator
`gU$` and such could previously (before atom#555 was merged) put the cursor at the end of the line, not the last character as expected in vim mode
1 parent e168473 commit 88c7f97

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spec/operators-spec.coffee

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,13 @@ describe "Operators", ->
13641364
keydown("e")
13651365
expect(editor.getText()).toBe 'ABC\nXyZ'
13661366

1367+
editor.setCursorBufferPosition([1, 0])
1368+
keydown("g")
1369+
keydown("U", shift: true)
1370+
keydown("$")
1371+
expect(editor.getText()).toBe 'ABC\nXYZ'
1372+
expect(editor.getCursorScreenPosition()).toEqual [1, 2]
1373+
13671374
it "makes the selected text uppercase in visual mode", ->
13681375
keydown("V", shift: true)
13691376
keydown("U", shift: true)
@@ -1377,8 +1384,9 @@ describe "Operators", ->
13771384
it "makes text lowercase with g and motion", ->
13781385
keydown("g")
13791386
keydown("u")
1380-
keydown("e")
1387+
keydown("$")
13811388
expect(editor.getText()).toBe 'abc\nXyZ'
1389+
expect(editor.getCursorScreenPosition()).toEqual [0, 2]
13821390

13831391
it "makes the selected text lowercase in visual mode", ->
13841392
keydown("V", shift: true)

0 commit comments

Comments
 (0)