Skip to content

Commit

Permalink
Let the editor copy a string representing the caret position for gdb …
Browse files Browse the repository at this point in the history
…breakpoints.

Select the added menu and then:
- Go in gdb
- Type "b "
- Paste
  • Loading branch information
jturcotte committed May 18, 2012
1 parent 84e5468 commit 3a596d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Context.sublime-menu
@@ -0,0 +1,3 @@
[
{ "command": "copy_basename_and_line", "caption": "Copy \"filename:line\"" }
]
9 changes: 8 additions & 1 deletion clipboard_path.py
Expand Up @@ -59,4 +59,11 @@ def run(self):
if line:
self.window.open_file(resolvedPath + ':' + line, sublime.ENCODED_POSITION)
else:
self.window.open_file(resolvedPath)
self.window.open_file(resolvedPath)

class CopyBasenameAndLineCommand(sublime_plugin.TextCommand):
def run(self, edit):
if self.view.file_name():
basename = os.path.basename(self.view.file_name())
line = self.view.rowcol(self.view.sel()[0].a)[0] + 1
sublime.set_clipboard('%s:%s' % (basename, line))

0 comments on commit 3a596d3

Please sign in to comment.