Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 55404c2

Browse files
authored
Decouple core indentation logic from spec
1 parent 87fcc84 commit 55404c2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spec/snippets-spec.coffee

+6-4
Original file line numberDiff line numberDiff line change
@@ -583,14 +583,16 @@ describe "Snippets extension", ->
583583
expect(editor.lineTextForBufferRow(0)).toBe "xxte var quicksort = function () {"
584584
expect(editor.getCursorScreenPosition()).toEqual [0, 6]
585585

586-
describe "when text is selected", ->
587-
it "inserts a tab as normal", ->
586+
describe "when a snippet matching prefix is selected", ->
587+
it "does not expand the snippet", ->
588588
editor.insertText("t1")
589589
editor.setSelectedBufferRange([[0, 0], [0, 2]])
590+
originalLine = editor.lineTextForBufferRow(0)
590591

591592
simulateTabKeyEvent()
592-
expect(editor.lineTextForBufferRow(0)).toBe " t1var quicksort = function () {"
593-
expect(editor.getSelectedBufferRange()).toEqual [[0, 0], [0, 4]]
593+
expect(editor.lineTextForBufferRow(0)).not.toEqual originalLine
594+
expect(editor.lineTextForBufferRow(0)).toContain "var quicksort = function () {"
595+
expect(editor.lineTextForBufferRow(0)).not.toContain "this is a test"
594596

595597
describe "when a previous snippet expansion has just been undone", ->
596598
describe "when the tab stops appear in the middle of the snippet", ->

0 commit comments

Comments
 (0)