mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 17:53:59 +00:00
Refactor SQL editor to integrate word wrap settings and remove redundant options in QueryTab
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
import useEffect from '../utility/useEffect';
|
import useEffect from '../utility/useEffect';
|
||||||
import { getContext } from 'svelte';
|
import { getContext } from 'svelte';
|
||||||
import { mountCodeCompletion } from './codeCompletion';
|
import { mountCodeCompletion } from './codeCompletion';
|
||||||
import { getCurrentSettings } from '../stores';
|
import { currentEditorWrapEnabled, getCurrentSettings } from '../stores';
|
||||||
export let engine = null;
|
export let engine = null;
|
||||||
export let conid = null;
|
export let conid = null;
|
||||||
export let database = null;
|
export let database = null;
|
||||||
@@ -29,6 +29,8 @@
|
|||||||
mode = engineToMode[match ? match[1] : engine] || 'sql';
|
mode = engineToMode[match ? match[1] : engine] || 'sql';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: enableWrap = $currentEditorWrapEnabled || false;
|
||||||
|
|
||||||
export function getEditor(): ace.Editor {
|
export function getEditor(): ace.Editor {
|
||||||
return domEditor.getEditor();
|
return domEditor.getEditor();
|
||||||
}
|
}
|
||||||
@@ -63,5 +65,6 @@
|
|||||||
options={{
|
options={{
|
||||||
...$$props.options,
|
...$$props.options,
|
||||||
enableBasicAutocompletion: true,
|
enableBasicAutocompletion: true,
|
||||||
|
wrap: enableWrap,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -720,9 +720,6 @@
|
|||||||
...driver?.getQuerySplitterOptions('editor'),
|
...driver?.getQuerySplitterOptions('editor'),
|
||||||
splitByEmptyLine: !$settingsValue?.['sqlEditor.disableSplitByEmptyLine'],
|
splitByEmptyLine: !$settingsValue?.['sqlEditor.disableSplitByEmptyLine'],
|
||||||
}}
|
}}
|
||||||
options={{
|
|
||||||
wrap: enableWrap,
|
|
||||||
}}
|
|
||||||
value={$editorState.value || ''}
|
value={$editorState.value || ''}
|
||||||
menu={createMenu()}
|
menu={createMenu()}
|
||||||
on:input={e => {
|
on:input={e => {
|
||||||
|
|||||||
Reference in New Issue
Block a user