Allow editor command palette to overflow (#764)

This commit is contained in:
Jonatan Kłosko 2021-12-06 14:15:44 +01:00 committed by GitHub
parent e98bfacfd0
commit 84222d0a0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -105,6 +105,13 @@ Also some spacing adjustments.
margin: 0 !important; margin: 0 !important;
} }
/* Command palette height is computed based on editor height,
which is not what we want, since the editor can have just
a single line, hence we override with a fixed height */
.monaco-editor .quick-input-list .monaco-list {
max-height: 300px !important;
}
/* === Monaco cursor widget === */ /* === Monaco cursor widget === */
.monaco-cursor-widget-container { .monaco-cursor-widget-container {

View file

@ -218,6 +218,19 @@ class LiveEditor {
"editor.action.showHover", "editor.action.showHover",
monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_I monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_I
); );
/* Overrides */
// Move the command palette widget to overflowing widgets container,
// so that it's visible on small editors.
// See: https://github.com/microsoft/monaco-editor/issues/70
const commandPaletteNode = this.editor.getContribution(
"editor.controller.quickInput"
).widget.domNode;
commandPaletteNode.remove();
this.editor._modelData.view._contentWidgets.overflowingContentWidgetsDomNode.domNode.appendChild(
commandPaletteNode
);
} }
/** /**