This repository was archived by the owner on Mar 12, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,14 @@ def getSelection():
180180 return text
181181
182182
183+ def getCurrentSyntax ():
184+ view = View ()
185+ currentSyntax = None
186+ if view :
187+ currentSyntax = view .settings ().get ('syntax' )
188+ return currentSyntax
189+
190+
183191class ST (EventListener ):
184192 conn = None
185193 tables = []
@@ -391,10 +399,7 @@ def cb(index):
391399
392400class StDescTable (WindowCommand ):
393401 def run (self ):
394- view = self .window .active_view ()
395- currentSyntax = None
396- if view :
397- currentSyntax = view .settings ().get ('syntax' )
402+ currentSyntax = getCurrentSyntax ()
398403
399404 if not ST .conn :
400405 ST .selectConnection (tablesCallback = lambda : Window ().run_command ('st_desc_table' ))
@@ -410,10 +415,7 @@ def cb(index):
410415
411416class StDescFunction (WindowCommand ):
412417 def run (self ):
413- view = self .window .active_view ()
414- currentSyntax = None
415- if view :
416- currentSyntax = view .settings ().get ('syntax' )
418+ currentSyntax = getCurrentSyntax ()
417419
418420 if not ST .conn :
419421 ST .selectConnection (functionsCallback = lambda : Window ().run_command ('st_desc_function' ))
You can’t perform that action at this time.
0 commit comments