From 83dc1c76ef13dbd172cd6366fb8b90c1e1e22628 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 27 Feb 2014 19:31:23 -0800 Subject: [PATCH] Add a spec that corrupts the row map by partially editing a fold --- spec/display-buffer-spec.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/display-buffer-spec.coffee b/spec/display-buffer-spec.coffee index f10e9844d..ab937ca97 100644 --- a/spec/display-buffer-spec.coffee +++ b/spec/display-buffer-spec.coffee @@ -460,6 +460,12 @@ describe "DisplayBuffer", -> expect(changeHandler).toHaveBeenCalledWith(start: 3, end: 3, screenDelta: 1, bufferDelta: 1) + describe "when the change starts at the beginning of a fold but does not extend to the end (regression)", -> + it "preserves a proper mapping between buffer and screen coordinates", -> + expect(displayBuffer.screenPositionForBufferPosition([8, 0])).toEqual [4, 0] + buffer.setTextInRange([[2, 0], [3, 0]], "\n") + expect(displayBuffer.screenPositionForBufferPosition([8, 0])).toEqual [4, 0] + describe "position translation", -> it "translates positions to account for folded lines and characters and the placeholder", -> fold = displayBuffer.createFold(4, 7)