If command panel selects text within a fold, the fold is destroyed

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-06-14 14:00:35 -07:00
parent 8a2aa881f7
commit 9ada2daebd
3 changed files with 19 additions and 1 deletions

View File

@@ -232,4 +232,16 @@ describe "CommandInterpreter", ->
interpreter.eval(editor, 's/current/foo/g')
expect(buffer.lineForRow(5)).toBe ' foo = items.shift();'
expect(buffer.lineForRow(6)).toBe ' foo < pivot ? left.push(foo) : right.push(current);'
expect(buffer.lineForRow(6)).toBe ' foo < pivot ? left.push(foo) : right.push(current);'
describe "when command selects folded text", ->
it "unfolds lines that command selects", ->
editor.createFold(1, 9)
editor.createFold(5, 8)
editor.setSelectedBufferRange([[0,0], [0,0]])
interpreter.eval(editor, '/push/')
expect(editor.getSelection().getBufferRange()).toEqual [[6,29], [6,33]]
expect(editor.lineForScreenRow(1).fold).toBeUndefined()
expect(editor.lineForScreenRow(5).fold).toBeUndefined()
expect(editor.lineForScreenRow(6).text).toBe buffer.lineForRow(6)