From 3facbf6867f29acd57ac6f53b4286d672c2c6a42 Mon Sep 17 00:00:00 2001 From: Matthew Runyon Date: Tue, 7 Dec 2021 13:04:22 -0600 Subject: [PATCH 1/2] Only show cursor position in console input bar when scrollbar is visible --- packages/console/src/ConsoleInput.jsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/console/src/ConsoleInput.jsx b/packages/console/src/ConsoleInput.jsx index a97b1a6cc3..3c4328d566 100644 --- a/packages/console/src/ConsoleInput.jsx +++ b/packages/console/src/ConsoleInput.jsx @@ -367,11 +367,24 @@ export class ConsoleInput extends PureComponent { Math.min(contentHeight, maxHeight), MIN_INPUT_HEIGHT ); + + // Only show the cursor position in the ruler if the scrollbar will show + const shouldScroll = contentHeight > commandEditorHeight; + const options = this.commandEditor.getOptions(); + if (shouldScroll) { + options.hideCursorInOverviewRuler = false; + options.overviewRulerBorder = true; + } else { + options.hideCursorInOverviewRuler = true; + options.overviewRulerBorder = false; + } + this.setState( { commandEditorHeight, }, () => { + this.commandEditor.updateOptions(options); this.commandEditor.layout(); } ); From 6d7fd1bbdea2df799b316b09f8c7650c9a70e935 Mon Sep 17 00:00:00 2001 From: Matthew Runyon Date: Tue, 7 Dec 2021 16:14:42 -0600 Subject: [PATCH 2/2] Hide entire side ruler when scrollbar hidden --- packages/console/src/ConsoleInput.jsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/console/src/ConsoleInput.jsx b/packages/console/src/ConsoleInput.jsx index 3c4328d566..44a1890743 100644 --- a/packages/console/src/ConsoleInput.jsx +++ b/packages/console/src/ConsoleInput.jsx @@ -368,15 +368,13 @@ export class ConsoleInput extends PureComponent { MIN_INPUT_HEIGHT ); - // Only show the cursor position in the ruler if the scrollbar will show + // Only show the overview ruler (markings overlapping sroll bar area) if the scrollbar will show const shouldScroll = contentHeight > commandEditorHeight; const options = this.commandEditor.getOptions(); if (shouldScroll) { - options.hideCursorInOverviewRuler = false; - options.overviewRulerBorder = true; + options.overviewRulerLanes = undefined; // Resets to default } else { - options.hideCursorInOverviewRuler = true; - options.overviewRulerBorder = false; + options.overviewRulerLanes = 0; } this.setState(