From 9a496e62cbf91871bed25113b9cfb6fff7497b4b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 21 Jan 2015 16:02:21 -0700 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20apply=20line=20decorations=20to?= =?UTF-8?q?=20mini=20editors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/text-editor-presenter-spec.coffee | 8 ++++++++ src/text-editor-presenter.coffee | 2 ++ 2 files changed, 10 insertions(+) diff --git a/spec/text-editor-presenter-spec.coffee b/spec/text-editor-presenter-spec.coffee index 01cc0f625..c41bbef29 100644 --- a/spec/text-editor-presenter-spec.coffee +++ b/spec/text-editor-presenter-spec.coffee @@ -349,3 +349,11 @@ describe "TextEditorPresenter", -> expect(lineStateForScreenRow(presenter, 4).decorationClasses).toEqual ['a'] expect(lineStateForScreenRow(presenter, 5).decorationClasses).toEqual ['a'] expect(lineStateForScreenRow(presenter, 6).decorationClasses).toBeNull() + + it "does not apply line decorations to mini editors", -> + editor.setMini(true) + presenter = new TextEditorPresenter(model: editor, clientHeight: 10, scrollTop: 0, lineHeight: 10, lineOverdrawMargin: 0) + marker = editor.markBufferRange([[0, 0], [0, 0]]) + decoration = editor.decorateMarker(marker, type: 'line', class: 'a') + + expect(lineStateForScreenRow(presenter, 0).decorationClasses).toBeNull() diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index a2f018dd0..aa68e2b57 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -98,6 +98,8 @@ class TextEditorPresenter Math.max(contentWidth, @getClientWidth()) lineDecorationClassesForRow: (row) -> + return null if @model.isMini() + decorationClasses = null for markerId, decorations of @model.decorationsForScreenRowRange(row, row) when @model.getMarker(markerId).isValid() for decoration in decorations when decoration.isType('line')