fix(editor): stabilize SQL run-statement gutter width
This commit is contained in:
1 parent
0862e63389
commit
c398a07573
4 files changed
+14
-24
No files matched your search
@@ -448,9 +448,9 @@ let tableReferenceDropListenerRegistered = false;
|
||||
let imeCompositionActive = false;
|
||||
let pendingImeModelEmit = false;
|
||||
|
||||
function runStatementGutterExtension(markers = props.statementExecutionMarkers ?? []): import("@codemirror/state").Extension {
|
||||
function runStatementGutterExtension(): import("@codemirror/state").Extension {
|
||||
const showRunButtons = !props.hideExecutionControls && settingsStore.editorSettings.showStatementRunButtons;
|
||||
return shouldShowStatementGutter(showRunButtons, markers.length) ? (buildRunStatementGutterExtension?.() ?? []) : [];
|
||||
return shouldShowStatementGutter(showRunButtons) ? (buildRunStatementGutterExtension?.() ?? []) : [];
|
||||
}
|
||||
|
||||
let executableStatementRangeCache: ExecutableStatementRangeCache | null = null;
|
||||
@@ -4785,15 +4785,6 @@ watch(
|
||||
{ deep: true },
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.statementExecutionMarkers?.length ?? 0,
|
||||
() => {
|
||||
if (!view.value || !runGutterComp) return;
|
||||
// Remove the compartment entirely when controls and markers are absent so the editor keeps no empty gutter width.
|
||||
view.value.dispatch({ effects: runGutterComp.reconfigure(runStatementGutterExtension()) });
|
||||
},
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.connectionId,
|
||||
() => {
|
||||
@@ -5195,7 +5186,7 @@ defineExpose({
|
||||
}
|
||||
|
||||
:deep(.cm-run-statement-gutter) {
|
||||
min-width: 34px;
|
||||
min-width: 28px;
|
||||
}
|
||||
|
||||
:deep(.cm-run-statement-gutter .cm-gutterElement) {
|
||||
@@ -5203,8 +5194,8 @@ defineExpose({
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
min-width: 34px;
|
||||
padding: 0 5px;
|
||||
min-width: 28px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
:deep(.cm-statement-execution-marker) {
|
||||
|
||||
Reference in new issue
Block a user