From 233e77ee35e6406760fcdc114e7774d6a1eb6938 Mon Sep 17 00:00:00 2001 From: Aron Janarv Date: Mon, 21 Sep 2015 07:16:08 +0200 Subject: [PATCH] Support mutiple regions in OpenUrlUnderCursorCommand --- clickable_urls.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/clickable_urls.py b/clickable_urls.py index fc3efce..455a169 100644 --- a/clickable_urls.py +++ b/clickable_urls.py @@ -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):