Allow running non-continuous selected SQL code blocks in the query tool. #7293

This commit is contained in:
Aditya Toshniwal 2024-08-29 12:41:58 +05:30
parent a0f7d0d50f
commit 1a1734cf5c
2 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@ Bundled PostgreSQL Utilities
New features
************
| `Issue #7293 <https://github.com/pgadmin-org/pgadmin4/issues/7293>`_ - Allow running non-continuous selected SQL code blocks in the query tool.
Housekeeping
************

View File

@ -197,7 +197,7 @@ export default class CustomEditorView extends EditorView {
}
getSelection() {
return this.state.sliceDoc(this.state.selection.main.from, this.state.selection.main.to) ?? '';
return this.state.selection.ranges.map((range)=>this.state.sliceDoc(range.from, range.to)).join('') ?? '';
}
replaceSelection(newValue) {