Created
January 30, 2014 08:20
-
-
Save jbjornson/8704545 to your computer and use it in GitHub Desktop.
SublimeText 3 version for OracleSQL file oracle_commands.py (https://github.com/bizoo/OracleSQL)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
import OracleSQL.oracle_lib | |
class OracleGotoBodyCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
def _on_change(result): | |
try: | |
ln = int(result) - 1 | |
if ln >= 0: | |
row, col = self.view.rowcol(pkgbody.begin()) | |
pos = self.view.text_point(row + ln, 0) | |
reg = sublime.Region(pos, pos) | |
self.view.sel().clear() | |
self.view.sel().add(reg) | |
self.view.show(reg) | |
except: | |
ln = None | |
pkgbody = oracle_lib.find_body(self.view) | |
if pkgbody: | |
self.view.window().show_input_panel('Package body line number:', '', _on_change, _on_change, None) | |
else: | |
sublime.error_message('Error: Package body not found !') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment