Skip to content

Instantly share code, notes, and snippets.

@chriswl
Forked from Snegovikufa/Context.sublime-menu
Last active December 19, 2015 01:38
Show Gist options
  • Save chriswl/5876844 to your computer and use it in GitHub Desktop.
Save chriswl/5876844 to your computer and use it in GitHub Desktop.

Revisions

  1. chriswl revised this gist Jun 27, 2013. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions TODO.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    - [ ] show list of breakpoints as a dropdown command
    - [ ] show current breakpoints in the gutter
    - [ ] find a way to synchronize breakpoints across machines

  2. chriswl revised this gist Jun 27, 2013. 1 changed file with 12 additions and 8 deletions.
    20 changes: 12 additions & 8 deletions pudbhelper.py
    Original file line number Diff line number Diff line change
    @@ -4,14 +4,18 @@

    from os.path import exists

    PUDB_FILE = '/home/snegovik/.config/pudb/saved-breakpoints'
    from os.path import expanduser
    home = expanduser("~")

    PUDB_FILE = home + '/.config/pudb/saved-breakpoints'


    class AddBreakpointCommand (sublime_plugin.TextCommand):
    def run (self, edit):
    def run(self, edit):
    filename = self.view.file_name()
    if filename and exists (PUDB_FILE) :
    with open (PUDB_FILE, 'a') as f :
    for selection in self.view.sel () :
    row, _ = self.view.rowcol (selection.begin ())
    breakpoint = "b %s:%d\n" % (filename, row+1)
    f.write (breakpoint)
    if filename and exists(PUDB_FILE):
    with open(PUDB_FILE, 'a') as f:
    for selection in self.view.sel():
    row, _ = self.view.rowcol(selection.begin())
    breakpoint = "b %s:%d\n" % (filename, row + 1)
    f.write(breakpoint)
  3. @Snegovikufa Snegovikufa revised this gist Jan 14, 2013. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Default.sublime-commands
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    [
    {
    "caption": "Breakpoint helper for pudb",
    "command": "add_breakpoint"
    }
    ]
  4. @Snegovikufa Snegovikufa revised this gist Jan 14, 2013. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Context.sublime-menu
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    [
    {
    "command": "add_breakpoint",
    "caption": "Add pudb breakpoint"
    }
    ]
  5. @Snegovikufa Snegovikufa created this gist Jan 14, 2013.
    17 changes: 17 additions & 0 deletions pudbhelper.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/usr/bin/python
    import sublime
    import sublime_plugin

    from os.path import exists

    PUDB_FILE = '/home/snegovik/.config/pudb/saved-breakpoints'

    class AddBreakpointCommand (sublime_plugin.TextCommand):
    def run (self, edit):
    filename = self.view.file_name()
    if filename and exists (PUDB_FILE) :
    with open (PUDB_FILE, 'a') as f :
    for selection in self.view.sel () :
    row, _ = self.view.rowcol (selection.begin ())
    breakpoint = "b %s:%d\n" % (filename, row+1)
    f.write (breakpoint)