Skip to content
Snippets Groups Projects
Unverified Commit e840233a authored by Romeo Van Snick's avatar Romeo Van Snick Committed by GitHub
Browse files

Add custom selectionchange handler (#49511)

parent 924c6d31
No related branches found
No related tags found
No related merge requests found
......@@ -360,6 +360,12 @@ export class NativeQueryEditor extends Component<
100,
);
handleSelectionChange = () => {
if (this._editor && this.props.setNativeEditorSelectedRange) {
this.props.setNativeEditorSelectedRange(this._editor.getSelectionRange());
}
};
handleKeyDown = (e: KeyboardEvent) => {
const { isRunning, cancelQuery, enableRun } = this.props;
......@@ -421,7 +427,7 @@ export class NativeQueryEditor extends Component<
// listen to onChange events
editor.getSession().on("change", this.onChange);
editor.getSelection().on("changeCursor", this.handleCursorChange);
editor.getSelection().on("changeSelection", this.handleCursorChange);
editor.getSelection().on("changeSelection", this.handleSelectionChange);
const minLineNumberWidth = 20;
editor.getSession().gutterRenderer = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment