Skip to content

Commit

Permalink
Add highlight_evaluated_form setting
Browse files Browse the repository at this point in the history
  • Loading branch information
eerohele committed Feb 19, 2024
1 parent 847186f commit 9eaa1e6
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,17 +455,18 @@ def noop(*args):
pass

def highlight_region(self, region):
id = str(uuid.uuid4())

self.view.add_regions(
id,
[region],
"comment",
"",
sublime.RegionFlags.DRAW_NO_FILL,
)
if region and settings.load().get("highlight_evaluated_form", True):
id = "tutkain/eval-" + str(uuid.uuid4())

self.view.add_regions(
id,
[region],
"comment",
"",
sublime.RegionFlags.DRAW_NO_FILL,
)

sublime.set_timeout_async(lambda: self.view.erase_regions(id), 3000)
sublime.set_timeout_async(lambda: self.view.erase_regions(id), 3000)

def run(
self,
Expand Down

0 comments on commit 9eaa1e6

Please sign in to comment.