diff --git a/SQLTools.sublime-settings b/SQLTools.sublime-settings index 4bd5fd8..03d811c 100644 --- a/SQLTools.sublime-settings +++ b/SQLTools.sublime-settings @@ -38,7 +38,8 @@ "limit": 50 }, "show_query": { - "placement": "disabled" + "enabled": true, + "placement": "top" }, "format" : { "keyword_case" : "upper", diff --git a/SQLToolsAPI/Command.py b/SQLToolsAPI/Command.py index 5a28589..0283da9 100644 --- a/SQLToolsAPI/Command.py +++ b/SQLToolsAPI/Command.py @@ -70,9 +70,10 @@ def run(self): if self.process: self.process.terminate() - if 'show_query' in self.options and self.options['show_query']: - formattedQueryInfo = self._formatShowQuery(self.query, queryTimerStart, queryTimerEnd) - self.callback(formattedQueryInfo) + if 'show_query' in self.options: + if 'enabled' in self.options['show_query'] and self.options['show_query']['enabled']: + formattedQueryInfo = self._formatShowQuery(self.query, queryTimerStart, queryTimerEnd) + self.callback(formattedQueryInfo + '\n') return @@ -93,13 +94,13 @@ def run(self): 'replace').replace('\r', '') if 'show_query' in self.options: - queryPlacement = self.options['show_query'].get('placement', 'disabled') - if isinstance(queryPlacement, str) and queryPlacement != 'disabled': + if 'enabled' in self.options['show_query'] and self.options['show_query']['enabled']: formattedQueryInfo = self._formatShowQuery(self.query, queryTimerStart, queryTimerEnd) + queryPlacement = self.options['show_query'].get('placement', 'top') if queryPlacement == 'top': resultString = "{0}\n{1}".format(formattedQueryInfo, resultString) elif queryPlacement == 'bottom': - resultString = "{0}\n{1}".format(resultString, formattedQueryInfo) + resultString = "{0}{1}\n".format(resultString, formattedQueryInfo) self.callback(resultString)