Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

feat(editor): add middle-mouse-button rectangular selection in SQL editor

t8y2c49811cf5a52
diff --git a/src/components/editor/QueryEditor.vue b/src/components/editor/QueryEditor.vue
index 0d55651a7f..970a3853bc 100644
--- a/src/components/editor/QueryEditor.vue
+++ b/src/components/editor/QueryEditor.vue
@@ -251,7 +251,7 @@ onMounted(async () => {
if (!editorRef.value) return;
const [
- { EditorView, keymap },
+ { EditorView, keymap, rectangularSelection },
{ EditorState, Compartment, Prec },
{ sql, MSSQL, MySQL, PostgreSQL, SQLDialect },
{ basicSetup },
@@ -267,7 +267,7 @@ onMounted(async () => {
import("@codemirror/commands"),
import("@codemirror/language"),
]);
- editorViewModule = { EditorView, keymap } as typeof import("@codemirror/view");
+ editorViewModule = { EditorView, keymap, rectangularSelection } as typeof import("@codemirror/view");
fontThemeComp = new Compartment();
codeMirrorTheme = new Compartment();
wordWrapComp = new Compartment();
@@ -339,6 +339,7 @@ onMounted(async () => {
runKeymap,
wordWrapComp.of(props.forceWordWrap || ss.wordWrap ? EditorView.lineWrapping : []),
readOnlyComp.of([EditorState.readOnly.of(!!props.readOnly), EditorView.editable.of(!props.readOnly)]),
+ rectangularSelection({ eventFilter: (e: MouseEvent) => e.altKey || e.button === 1 }),
EditorView.updateListener.of((update) => {
if (update.docChanged) {
emit("update:modelValue", update.state.doc.toString());