mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-153630 gdb console is blinking and adding and deleting scroll bar
try to align width of two editors
This commit is contained in:
@@ -32,6 +32,7 @@ import com.intellij.openapi.editor.*;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.editor.ex.FocusChangeListener;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.editor.ex.util.LexerEditorHighlighter;
|
||||
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
|
||||
import com.intellij.openapi.editor.highlighter.EditorHighlighterFactory;
|
||||
@@ -632,6 +633,23 @@ public class LanguageConsoleImpl extends ConsoleViewImpl implements LanguageCons
|
||||
final Dimension historySize = history.getContentSize();
|
||||
final Dimension inputSize = input.getContentSize();
|
||||
|
||||
// deal with width
|
||||
if (isHistoryViewerForceAdditionalColumnsUsage()) {
|
||||
history.getSoftWrapModel().forceAdditionalColumnsUsage();
|
||||
|
||||
int minAdditionalColumns = 2;
|
||||
// calculate content size without additional columns except minimal amount
|
||||
int historySpaceWidth = EditorUtil.getPlainSpaceWidth(history);
|
||||
historySize.width += historySpaceWidth * (minAdditionalColumns - history.getSettings().getAdditionalColumnsCount());
|
||||
// calculate content size without additional columns except minimal amount
|
||||
int inputSpaceWidth = EditorUtil.getPlainSpaceWidth(input);
|
||||
inputSize.width += inputSpaceWidth * (minAdditionalColumns - input.getSettings().getAdditionalColumnsCount());
|
||||
// calculate additional columns according to the corresponding width
|
||||
int max = Math.max(historySize.width, inputSize.width);
|
||||
history.getSettings().setAdditionalColumnsCount(minAdditionalColumns + (max - historySize.width) / historySpaceWidth);
|
||||
input.getSettings().setAdditionalColumnsCount(minAdditionalColumns + (max - inputSize.width) / inputSpaceWidth);
|
||||
}
|
||||
|
||||
int newInputHeight;
|
||||
// deal with height, WEB-11122 we cannot trust editor width - it could be 0 in case of soft wrap even if editor has text
|
||||
if (history.getDocument().getLineCount() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user