mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 22:36:01 +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 { getContext } from 'svelte';
|
||||
import { mountCodeCompletion } from './codeCompletion';
|
||||
import { getCurrentSettings } from '../stores';
|
||||
import { currentEditorWrapEnabled, getCurrentSettings } from '../stores';
|
||||
export let engine = null;
|
||||
export let conid = null;
|
||||
export let database = null;
|
||||
@@ -29,6 +29,8 @@
|
||||
mode = engineToMode[match ? match[1] : engine] || 'sql';
|
||||
}
|
||||
|
||||
$: enableWrap = $currentEditorWrapEnabled || false;
|
||||
|
||||
export function getEditor(): ace.Editor {
|
||||
return domEditor.getEditor();
|
||||
}
|
||||
@@ -63,5 +65,6 @@
|
||||
options={{
|
||||
...$$props.options,
|
||||
enableBasicAutocompletion: true,
|
||||
wrap: enableWrap,
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -720,9 +720,6 @@
|
||||
...driver?.getQuerySplitterOptions('editor'),
|
||||
splitByEmptyLine: !$settingsValue?.['sqlEditor.disableSplitByEmptyLine'],
|
||||
}}
|
||||
options={{
|
||||
wrap: enableWrap,
|
||||
}}
|
||||
value={$editorState.value || ''}
|
||||
menu={createMenu()}
|
||||
on:input={e => {
|
||||
|
||||
Reference in New Issue
Block a user