Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #25 from aronj/master
Browse files Browse the repository at this point in the history
Support mutiple regions in OpenUrlUnderCursorCommand
  • Loading branch information
leonid-shevtsov authored Jan 27, 2023
2 parents 6e0e7a2 + 233e77e commit d27020b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions clickable_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ def open_url(url):
class OpenUrlUnderCursorCommand(sublime_plugin.TextCommand):
def run(self, edit):
if self.view.id() in UrlHighlighter.urls_for_view:
selection = self.view.sel()[0]
if selection.empty():
selection = next((url for url in UrlHighlighter.urls_for_view[self.view.id()] if url.contains(selection)), None)
if not selection:
return
url = self.view.substr(selection)
open_url(url)
for selection in self.view.sel():
if selection.empty():
selection = next((url for url in UrlHighlighter.urls_for_view[self.view.id()] if url.contains(selection)), None)
if not selection:
return
url = self.view.substr(selection)
open_url(url)


class OpenAllUrlsCommand(sublime_plugin.TextCommand):
Expand Down

0 comments on commit d27020b

Please sign in to comment.