From e9118142dbf0da4d6243c466f4a05b08f28d84e3 Mon Sep 17 00:00:00 2001 From: Ting-Kuan Date: Mon, 24 Mar 2014 10:54:59 -0400 Subject: [PATCH] Fix issue #662 --- app/views/play/level/tome/spell_toolbar_view.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/play/level/tome/spell_toolbar_view.coffee b/app/views/play/level/tome/spell_toolbar_view.coffee index 98464bf20..2abd5460d 100644 --- a/app/views/play/level/tome/spell_toolbar_view.coffee +++ b/app/views/play/level/tome/spell_toolbar_view.coffee @@ -103,8 +103,8 @@ module.exports = class SpellToolbarView extends View updateScroll: -> return unless statementStart = @callState?.statements?[@statementIndex]?.range[0] - text = @ace.getValue() - currentLine = text.substr(0, statementStart).split('\n').length - 1 + text = @ace.getValue() # code in editor + currentLine = statementStart.row @ace.scrollToLine currentLine, true, true setCallState: (callState, statementIndex, @callIndex, @metrics) ->