From 85200e1f8ac61d0d0131898474918cce4fb2d009 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Tue, 24 May 2016 17:31:55 +0300 Subject: [PATCH] REPL UI: fix history pane not showing latest command after command execution --- .../src/org/jetbrains/kotlin/console/HistoryUpdater.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/idea/idea-repl/src/org/jetbrains/kotlin/console/HistoryUpdater.kt b/idea/idea-repl/src/org/jetbrains/kotlin/console/HistoryUpdater.kt index a8c933dafe2..fadfabc350f 100644 --- a/idea/idea-repl/src/org/jetbrains/kotlin/console/HistoryUpdater.kt +++ b/idea/idea-repl/src/org/jetbrains/kotlin/console/HistoryUpdater.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package org.jetbrains.kotlin.console import com.intellij.execution.console.LanguageConsoleImpl import com.intellij.openapi.editor.ex.EditorEx -import com.intellij.openapi.editor.ex.util.EditorUtil import com.intellij.openapi.editor.markup.HighlighterLayer import com.intellij.openapi.editor.markup.HighlighterTargetArea import com.intellij.openapi.util.TextRange @@ -35,7 +34,6 @@ class HistoryUpdater(private val runner: KotlinConsoleRunner) { val endOffset = startOffset + trimmedCommandText.length addCommandTextToHistoryEditor(trimmedCommandText) - EditorUtil.scrollToTheEnd(historyEditor) addFoldingRegion(historyEditor, startOffset, endOffset, trimmedCommandText) historyEditor.markupModel.addRangeHighlighter( @@ -44,6 +42,9 @@ class HistoryUpdater(private val runner: KotlinConsoleRunner) { val historyMarker = if (runner.isReadLineMode) ReplIcons.READLINE_MARKER else ReplIcons.COMMAND_MARKER gutterIconRenderer = ConsoleIndicatorRenderer(historyMarker) } + + historyEditor.scrollingModel.scrollVertically(endOffset) + return TextRange(startOffset, endOffset) }