mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 22:36:01 +00:00
SYNC: disable splitting queries with blank lines? #1162
This commit is contained in:
committed by
Diflow
parent
17835832f2
commit
90e4fd7ff5
@@ -279,7 +279,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
$: {
|
||||
splitterOptions;
|
||||
closeQueryParserWorker();
|
||||
}
|
||||
$: watchQueryParserWorker(splitterOptions && $tabVisible);
|
||||
|
||||
function closeQueryParserWorker() {
|
||||
if (queryParserWorker) {
|
||||
if (queryParserWorker != 'fallback') {
|
||||
queryParserWorker.terminate();
|
||||
}
|
||||
queryParserWorker = null;
|
||||
}
|
||||
}
|
||||
|
||||
function watchQueryParserWorker(enabled) {
|
||||
if (enabled) {
|
||||
if (!queryParserWorker) {
|
||||
|
||||
@@ -245,6 +245,12 @@ ORDER BY
|
||||
label="Show table aliases in code completion"
|
||||
defaultValue={false}
|
||||
/>
|
||||
|
||||
<FormCheckboxField
|
||||
name="sqlEditor.disableSplitByEmptyLine"
|
||||
label="Disable split by empty line"
|
||||
defaultValue={false}
|
||||
/>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="2">
|
||||
<div class="heading">Connection</div>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
import { currentEditorWrapEnabled, extensions, getCurrentDatabase } from '../stores';
|
||||
import applyScriptTemplate from '../utility/applyScriptTemplate';
|
||||
import { changeTab, markTabUnsaved, sleep } from '../utility/common';
|
||||
import { getDatabaseInfo, useConnectionInfo } from '../utility/metadataLoaders';
|
||||
import { getDatabaseInfo, useConnectionInfo, useSettings } from '../utility/metadataLoaders';
|
||||
import SocketMessageView from '../query/SocketMessageView.svelte';
|
||||
import useEffect from '../utility/useEffect';
|
||||
import ResultTabs from '../query/ResultTabs.svelte';
|
||||
@@ -232,6 +232,8 @@
|
||||
return getIntSettingsValue('sqlEditor.limitRows', null, 1);
|
||||
}
|
||||
|
||||
const settingsValue = useSettings();
|
||||
|
||||
let queryRowsLimit = getInitialRowsLimit();
|
||||
$: localStorage.setItem(queryRowsLimitLocalStorageKey, queryRowsLimit ? queryRowsLimit.toString() : 'nolimit');
|
||||
|
||||
@@ -332,7 +334,7 @@
|
||||
...driver.getQuerySplitterOptions('editor'),
|
||||
queryParameterStyle,
|
||||
allowDollarDollarString: false,
|
||||
splitByEmptyLine: true,
|
||||
splitByEmptyLine: !$settingsValue?.['sqlEditor.disableSplitByEmptyLine'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -707,7 +709,10 @@
|
||||
engine={$connection && $connection.engine}
|
||||
{conid}
|
||||
{database}
|
||||
splitterOptions={{ ...driver?.getQuerySplitterOptions('editor'), splitByEmptyLine: true }}
|
||||
splitterOptions={{
|
||||
...driver?.getQuerySplitterOptions('editor'),
|
||||
splitByEmptyLine: !$settingsValue?.['sqlEditor.disableSplitByEmptyLine'],
|
||||
}}
|
||||
options={{
|
||||
wrap: enableWrap,
|
||||
}}
|
||||
@@ -737,7 +742,10 @@
|
||||
<AceEditor
|
||||
mode={driver?.editorMode || 'sql'}
|
||||
value={$editorState.value || ''}
|
||||
splitterOptions={{ ...driver?.getQuerySplitterOptions('editor'), splitByEmptyLine: true }}
|
||||
splitterOptions={{
|
||||
...driver?.getQuerySplitterOptions('editor'),
|
||||
splitByEmptyLine: !$settingsValue?.['sqlEditor.disableSplitByEmptyLine'],
|
||||
}}
|
||||
options={{
|
||||
wrap: enableWrap,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user