From 20a95269c90264fc02cd53a75de035881fa5e068 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 3 Feb 2015 14:45:58 -0700 Subject: [PATCH] Preserve line number for mouseWheelScreenRow in a sane way What we were doing before made no sense. Signed-off-by: Max Brunsfeld --- src/text-editor-presenter.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 4b0aefa1a..7eb29b6b0 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -267,11 +267,11 @@ class TextEditorPresenter visibleLineNumberIds[id] = true if @mouseWheelScreenRow? - screenRow = @mouseWheelScreenRow - top = screenRow * @lineHeight - bufferRow = @model.bufferRowForScreenRow(screenRow) - @state.gutter.lineNumbers[id] = {screenRow, bufferRow, top} - visibleLineNumberIds[bufferRow] = true + bufferRow = @model.bufferRowForScreenRow(@mouseWheelScreenRow) + wrapCount = @mouseWheelScreenRow - @model.screenRowForBufferRow(bufferRow) + id = bufferRow + id += '-' + wrapCount if wrapCount > 0 + visibleLineNumberIds[id] = true for id of @state.gutter.lineNumbers delete @state.gutter.lineNumbers[id] unless visibleLineNumberIds[id]