Skip to content

Commit bbd280c

Browse files
committed
WIP fix issues identified by mypy
1 parent 54e171f commit bbd280c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import subprocess
44
import sys
55
from abc import ABCMeta, abstractmethod
6-
from urllib.parse import parse_qs, quote_plus, urlparse
6+
from urllib.parse import parse_qs, urlparse
77

88
import sublime
99

@@ -96,12 +96,12 @@ def handle_phantom_button(self, href):
9696
elif url.path == "show":
9797
sha = querystring["sha"][0]
9898
try:
99-
desc = self.get_commit_text(sha, self.view.file_name())
99+
desc = self.get_commit_text(sha, self._view().file_name())
100100
except Exception as e:
101101
self.communicate_error(e)
102102
return
103103

104-
buf = self.view.window().new_file()
104+
buf = self._view().window().new_file()
105105
buf.run_command(
106106
"blame_insert_commit_description",
107107
{"desc": desc, "scratch_view_name": "commit " + sha},

src/blame_all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def run(self, edit):
2727
return
2828

2929
self.view.erase_phantoms(PHANTOM_KEY_ALL)
30-
phantoms = [] # type: list[sublime.Phantom]
30+
phantoms = [] # type: list[sublime.Phantom] # type: ignore[misc]
3131

3232
# If they are currently shown, toggle them off and return.
3333
if self.view.settings().get(VIEW_SETTING_PHANTOM_ALL_DISPLAYED, False):

src/blame_inline.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
import threading
2+
23
import sublime
34
import sublime_plugin
45

56
from .base import BaseBlame
6-
from .templates import blame_inline_phantom_css, blame_inline_phantom_html_template
77
from .settings import (
8-
pkg_settings,
9-
PKG_SETTINGS_KEY_INLINE_BLAME_ENABLED,
108
PKG_SETTINGS_KEY_INLINE_BLAME_DELAY,
9+
PKG_SETTINGS_KEY_INLINE_BLAME_ENABLED,
10+
pkg_settings,
1111
)
12+
from .templates import blame_inline_phantom_css, blame_inline_phantom_html_template
1213

1314
INLINE_BLAME_PHANTOM_SET_KEY = "git-blame-inline"
1415

1516

1617
class BlameInlineListener(BaseBlame, sublime_plugin.ViewEventListener):
1718
@classmethod
1819
def is_applicable(cls, settings):
20+
# @todo Fix inline blame (sometimes?) remaining enabled when the user setting for it is edited from true -> false
1921
return pkg_settings().get(PKG_SETTINGS_KEY_INLINE_BLAME_ENABLED)
2022

2123
def __init__(self, view):

0 commit comments

Comments
 (0)