Skip to content

Commit fb4f794

Browse files
committed
Fix supplying incorrect regions for LAYOUT_INLINE phantoms
"Display the phantom in between the region and the point following" https://www.sublimetext.com/docs/api_reference.html#sublime.Phantom This was only noticed after testing in ST4 beta. Is ST3 more forgiving about interpreting regions given for LAYOUT_INLINE phantoms?
1 parent 917eecd commit fb4f794

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/blame_all.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,10 @@ def run(self, edit):
5555
max_author_len = max(len(b["author"]) for b in blames)
5656
for blame in blames:
5757
line_number = int(blame["line_number"])
58-
line_point = self.get_line_point(line_number - 1)
59-
6058
author = blame["author"]
6159

6260
phantom = sublime.Phantom(
63-
line_point,
61+
self.phantom_region(line_number),
6462
blame_all_phantom_html_template.format(
6563
css=blame_all_phantom_css,
6664
sha=blame["sha"],
@@ -93,9 +91,9 @@ def handle_phantom_button(self, href):
9391
if href == "close":
9492
self.view.run_command("blame_erase_all")
9593

96-
def get_line_point(self, line):
97-
"""Get the point of specified line in a view."""
98-
return self.view.line(self.view.text_point(line, 0))
94+
def phantom_region(self, line_number):
95+
line_begins_pt = self.view.text_point(line_number - 1, 0)
96+
return sublime.Region(line_begins_pt)
9997

10098
def store_rulers(self):
10199
self.view.settings().set(

0 commit comments

Comments
 (0)