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

Commit 31418f0

Browse files
committed
Fixed CMD window
1 parent 666ec72 commit 31418f0

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

SQLTools.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,37 +108,37 @@ def run (self):
108108
class StShowRecords(sublime_plugin.WindowCommand):
109109
def run(self):
110110
if not ST.conn:
111-
showConnectionMenu()
111+
ST.showConnectionMenu()
112112
return
113113

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

116116
class StDescTable(sublime_plugin.WindowCommand):
117117
def run(self):
118118
if not ST.conn:
119-
showConnectionMenu()
119+
ST.showConnectionMenu()
120120
return
121121

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

124124
class StHistory(sublime_plugin.WindowCommand):
125125
def run(self):
126126
if not ST.conn:
127-
showConnectionMenu()
127+
ST.showConnectionMenu()
128128
return
129129

130130
if len(History.queries) == 0:
131131
sublime.message_dialog('History is empty.')
132132
return
133133
try:
134-
Window().show_quick_panel(History.queries, lambda index: ST.conn.execute(History.get(index), ST.display))
134+
Window().show_quick_panel(History.queries, lambda index: ST.conn.execute(History.get(index), ST.display) if index != -1 else None)
135135
except Exception:
136136
pass
137137

138138
class StExecute(sublime_plugin.WindowCommand):
139139
def run(self):
140140
if not ST.conn:
141-
showConnectionMenu()
141+
ST.showConnectionMenu()
142142
return
143143

144144
query = Selection.get()

SQLToolsModels.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ def formatSql(edit):
196196
if region.empty():
197197
selectedRegion = sublime.Region(0, View().size())
198198
selection = View().substr(selectedRegion)
199-
print (Utils.formatSql(selection))
200199
View().replace(edit, selectedRegion, Utils.formatSql(selection))
201200
View().set_syntax_file("Packages/SQL/SQL.tmLanguage")
202201
else:

0 commit comments

Comments
 (0)