Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit 2eb9ba9

Browse files
committed
Fix
1 parent 029abae commit 2eb9ba9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

SQLTools.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def showConnectionMenu():
7070
for name, conn in ST.connectionList.items():
7171
menu.append(conn._quickPanel())
7272
menu.sort()
73-
Window().show_quick_panel(menu, ST.setConnection)
73+
STM.Window().show_quick_panel(menu, ST.setConnection)
7474

7575
def on_query_completions(self, view, prefix, locations):
7676
if prefix == "":
@@ -115,10 +115,10 @@ def checkDefaultConnection():
115115
@staticmethod
116116
def display(content, name="SQLTools Result"):
117117
if not sublime.load_settings(STM.Const.SETTINGS_FILENAME).get('show_result_on_window'):
118-
resultContainer = Window().create_output_panel(name)
119-
Window().run_command("show_panel", {"panel": "output." + name})
118+
resultContainer = STM.Window().create_output_panel(name)
119+
STM.Window().run_command("show_panel", {"panel": "output." + name})
120120
else:
121-
resultContainer = Window().new_file()
121+
resultContainer = STM.Window().new_file()
122122
resultContainer.set_name(name)
123123
resultContainer.set_scratch(True) # avoids prompting to save
124124

@@ -142,15 +142,15 @@ def run(self):
142142
ST.showConnectionMenu()
143143
return
144144

145-
Window().show_quick_panel(ST.tables, lambda index: ST.conn.getTableRecords(ST.tables[index], ST.display) if index != -1 else None)
145+
STM.Window().show_quick_panel(ST.tables, lambda index: ST.conn.getTableRecords(ST.tables[index], ST.display) if index != -1 else None)
146146

147147
class StDescTable(sublime_plugin.WindowCommand):
148148
def run(self):
149149
if not ST.conn:
150150
ST.showConnectionMenu()
151151
return
152152

153-
Window().show_quick_panel(ST.tables, lambda index: ST.conn.getTableDescription(ST.tables[index], ST.display) if index != -1 else None)
153+
STM.Window().show_quick_panel(ST.tables, lambda index: ST.conn.getTableDescription(ST.tables[index], ST.display) if index != -1 else None)
154154

155155
class StHistory(sublime_plugin.WindowCommand):
156156
def run(self):
@@ -162,7 +162,7 @@ def run(self):
162162
sublime.message_dialog('History is empty.')
163163
return
164164
try:
165-
Window().show_quick_panel(STM.History.queries, lambda index: ST.conn.execute(STM.History.get(index), ST.display) if index != -1 else None)
165+
STM.Window().show_quick_panel(STM.History.queries, lambda index: ST.conn.execute(STM.History.get(index), ST.display) if index != -1 else None)
166166
except Exception:
167167
pass
168168

@@ -197,7 +197,7 @@ def run(self):
197197
queriesArray.append([alias, query])
198198
queriesArray.sort()
199199
try:
200-
Window().show_quick_panel(queriesArray, lambda index: ST.conn.execute(queriesArray[index][1], ST.display) if index != -1 else None)
200+
STM.Window().show_quick_panel(queriesArray, lambda index: ST.conn.execute(queriesArray[index][1], ST.display) if index != -1 else None)
201201
except Exception:
202202
pass
203203

@@ -215,7 +215,7 @@ def run(self):
215215
queriesArray.append([alias, query])
216216
queriesArray.sort()
217217
try:
218-
Window().show_quick_panel(queriesArray, lambda index: STM.Storage.removeQuery(queriesArray[index][0]) if index != -1 else None)
218+
STM.Window().show_quick_panel(queriesArray, lambda index: STM.Storage.removeQuery(queriesArray[index][0]) if index != -1 else None)
219219
except Exception:
220220
pass
221221

0 commit comments

Comments
 (0)