sublime-sqlexec
sublime-sqlexec copied to clipboard
Focus the output panel with keyboard shortcut
First of all, great plugin!! :)
Second, the output gets displayed in some kind of "panel", I'm guessing by this code:
class Command:
def __init__(self, text):
self.text = text
def _display(self, panelName, text):
if not sublime.load_settings("SQLExec.sublime-settings").get('show_result_on_window'):
panel = sublime.active_window().create_output_panel(panelName)
sublime.active_window().run_command("show_panel", {"panel": "output." + panelName})
else:
panel = sublime.active_window().new_file()
panel.set_read_only(False)
panel.set_syntax_file('Packages/SQL/SQL.tmLanguage')
panel.run_command('append', {'characters': text})
panel.set_read_only(True)
Is there some way to focus this panel with a keyboard shortcut? Sometimes when the output gets large I want to be able to scroll in it and maybe do a ctrl+f in some large Desc Table results.
You could make it output to a new window instead.. see https://github.com/jum4/sublime-sqlexec/issues/28
Works great!
Ahh, nice one @TheunisKotze !
#28 in combination with a horizontal split worked quite nice.
For anyone interested in the split (makes the split and moves the tab you had opened to the group created underneath):
// `,hs` horizontal split columns and move current tab into right column
{
"keys": [",", "h", "s"],
"command": "run_multiple_commands",
"args": {
"commands": [
{
"command": "set_layout",
"args": {
"cols": [0.0, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
},
"context": "window"
},
{
"command": "move_group_focus",
"args": {"direction": "up"},
"context": "window"
},
{
"command": "move_to_group",
"args": { "group": 1 },
"context": "window"
}
]
}
},
Maybe the coup de grâce would be if the horizontal split was done automatically when executing the query :)