Home Download Buy Blog Forum Support

My blame plugin used to work, but now it doesn't...

My blame plugin used to work, but now it doesn't...

Postby ehamiter on Thu Aug 04, 2011 7:47 pm

This used to work just fine (as in, 2 weeks ago or so):

Code: Select all
import os
import sublime
import sublime_plugin

class BlameCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        if len(self.view.file_name()) > 0: 
            folder_name, file_name = os.path.split(self.view.file_name())
            begin_line, begin_column = self.view.rowcol(self.view.sel()[0].begin())
            end_line, end_column = self.view.rowcol(self.view.sel()[0].end())
            begin_line = str(begin_line)
            end_line = str(end_line)
            lines = begin_line + ',' + end_line
            self.view.window().run_command('exec', {'cmd': ['git', 'blame', '-L', lines, file_name], 'working_dir': folder_name})         
            sublime.status_message("git blame -L " + lines + " " + file_name)

    def is_enabled(self):
        return self.view.file_name() and len(self.view.file_name()) > 0



...but now it does nothing. No error message or anything. Did something change in the API that deprecates anything above? Could someone who uses git try this out and see if it works for them? I had this for user key bindings:

Code: Select all
{ "keys": ["super+shift+b"], "command": "blame" }
ehamiter
 
Posts: 67
Joined: Wed Apr 27, 2011 2:42 am

Re: My blame plugin used to work, but now it doesn't...

Postby ehamiter on Thu Aug 04, 2011 8:03 pm

How odd. "super+shift+b" does nothing, but if I change it to "super+alt+b", it works. I don't see any other plugin or default command that uses super+shift+b... I wonder why that doesn't work?
ehamiter
 
Posts: 67
Joined: Wed Apr 27, 2011 2:42 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests