From 3cfc518538ee00af9f639f9431915a2d6ecbceb1 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 26 Feb 2025 00:34:53 +0700 Subject: [PATCH] WIP. --- SQLFormatter.tableplusplugin/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SQLFormatter.tableplusplugin/main.js b/SQLFormatter.tableplusplugin/main.js index 7a9851b..d5aad79 100755 --- a/SQLFormatter.tableplusplugin/main.js +++ b/SQLFormatter.tableplusplugin/main.js @@ -4,7 +4,7 @@ import { formatSQL } from './library/helper'; var onRun = function(context) { // Get table in opening tab - var queryEditor = context.currentQueryEditor(); + var queryEditor = context.preferredEditor(); if (queryEditor == null) { context.alert('Error', 'No SQL Editor'); return; @@ -15,4 +15,4 @@ var onRun = function(context) { queryEditor.replaceStringInRange(formattedStatement, range); }; -global.onRun = onRun; \ No newline at end of file +global.onRun = onRun;