summaryrefslogtreecommitdiff
path: root/User/copy_pos.py
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2019-12-07 23:06:14 +0100
committerLaria Carolin Chabowski <laria@laria.me>2019-12-07 23:06:14 +0100
commitcdc9057adf122944ace0fc89d0a9f1e31c9a7ada (patch)
tree3609df8bc560e1e2b0af024cc2372a104960f639 /User/copy_pos.py
downloadsublime-text-3-packages-cdc9057adf122944ace0fc89d0a9f1e31c9a7ada.tar.gz
sublime-text-3-packages-cdc9057adf122944ace0fc89d0a9f1e31c9a7ada.tar.bz2
sublime-text-3-packages-cdc9057adf122944ace0fc89d0a9f1e31c9a7ada.zip
init
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