Skip to content

Commit

Permalink
Code lens on the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Jul 1, 2021
1 parent 686f693 commit 0c5f118
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions plugin/code_lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,15 @@ def unresolved_visible_code_lenses(self, visible: sublime.Region) -> Iterable[Co
yield lens

def _get_phantom_region(self, region: sublime.Region) -> sublime.Region:
line = self.view.substr(self.view.line(region))
line = self.view.line(region)
code = self.view.substr(line)
offset = 0
for ch in line:
for ch in code:
if ch.isspace():
offset += 1
else:
break
row, _ = self.view.rowcol(region.a)
point = self.view.text_point(max(row - 1, 0), offset, clamp_column=True)
return sublime.Region(point)
return sublime.Region(line.a + offset, line.b)

def render(self, mode: str) -> None:
if mode == 'phantom':
Expand Down

0 comments on commit 0c5f118

Please sign in to comment.