From cdc9057adf122944ace0fc89d0a9f1e31c9a7ada Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Sat, 7 Dec 2019 23:06:14 +0100 Subject: init --- User/copy_pos.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 User/copy_pos.py (limited to 'User/copy_pos.py') 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 -- cgit v1.2.3-54-g00ecf