-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathoracle_commands.py
More file actions
26 lines (22 loc) · 896 Bytes
/
oracle_commands.py
File metadata and controls
26 lines (22 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sublime
import sublime_plugin
import 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 !')