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 +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -412,20 +412,24 @@ def selectTable(callback):
412412 sublime .message_dialog ('Your database has no tables.' )
413413 return
414414
415- w = Window ();
416- view = w .active_view ()
417- text = view .substr (view .sel ()[0 ])
418- w .show_quick_panel (ST .tables , callback )
419- w .run_command ('insert' , {'characters' : text })
420- w .run_command ("select_all" )
415+ ST .show_quick_panel_with_selection (ST .tables , callback )
421416
422417 @staticmethod
423418 def selectFunction (callback ):
424419 if len (ST .functions ) == 0 :
425420 sublime .message_dialog ('Your database has no functions.' )
426421 return
427422
428- Window ().show_quick_panel (ST .functions , callback )
423+ ST .show_quick_panel_with_selection (ST .functions , callback )
424+
425+ @staticmethod
426+ def show_quick_panel_with_selection (arrayOfValues , callback ):
427+ w = Window ();
428+ view = w .active_view ()
429+ text = " " .join (map (lambda s : view .substr (s ), view .sel ())).replace ('\n ' , ' ' )
430+ w .show_quick_panel (arrayOfValues , callback )
431+ w .run_command ('insert' , {'characters' : text })
432+ w .run_command ("select_all" )
429433
430434 @staticmethod
431435 def on_query_completions (view , prefix , locations ):
You can’t perform that action at this time.
0 commit comments