Skip to content

Commit

Permalink
fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
predragnikolic committed Apr 6, 2023
1 parent f360262 commit 9a61591
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
from typing import List, Optional
import sublime
import sublime_plugin
Expand Down Expand Up @@ -61,8 +62,12 @@ def run(self, edit):
backtick_string_region = get_backtick_string_region(self.view, point)
if not backtick_string_region:
return
backtick_text = self.view.substr(backtick_string_region)
# make sure that the string is surrounded with backticks
if not re.match(r"^`.+`$", backtick_text):
return
# if there are ${ that means it is still a template string
if '${' in self.view.substr(backtick_string_region):
if '${' in backtick_text:
return
# else transform the template string to a regular string
first_quote = backtick_string_region.begin()
Expand Down

0 comments on commit 9a61591

Please sign in to comment.