summaryrefslogtreecommitdiff
path: root/User/copy_pos.py
diff options
context:
space:
mode:
Diffstat (limited to 'User/copy_pos.py')
-rw-r--r--User/copy_pos.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/User/copy_pos.py b/User/copy_pos.py
new file mode 100644
index 0000000..bda3654
--- /dev/null
+++ b/User/copy_pos.py
@@ -0,0 +1,13 @@
+import os.path
+import sublime
+import sublime_plugin
+
+
+class CopyPosCommand(sublime_plugin.TextCommand):
+ def run(self, edit):
+ try:
+ project_path = self.view.window().extract_variables().get("project_path", "")
+ line, _ = self.view.rowcol(next(iter(self.view.sel())).begin())
+ sublime.set_clipboard("{}:{}".format(os.path.relpath(self.view.file_name(), project_path), line+1))
+ except StopIteration:
+ pass