Title: [278776] trunk/Tools
- Revision
- 278776
- Author
- drou...@apple.com
- Date
- 2021-06-11 13:02:07 -0700 (Fri, 11 Jun 2021)
Log Message
Add an option to Copy WebKit Permalink that automatically opens the URL in the default browser for Sublime Text
https://bugs.webkit.org/show_bug.cgi?id=226933
Reviewed by Tim Horton.
Usually the step right after copying the permalink is to open a browser and enter it. Having
a setting that causes the plugin to do that automatically would save some time and effort.
* CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py:
(Settings.automatically_open_in_browser): Added.
(CopyWebKitPermalinkCommand.run):
* CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.sublime-settings:
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (278775 => 278776)
--- trunk/Tools/ChangeLog 2021-06-11 19:55:13 UTC (rev 278775)
+++ trunk/Tools/ChangeLog 2021-06-11 20:02:07 UTC (rev 278776)
@@ -1,3 +1,18 @@
+2021-06-11 Devin Rousso <drou...@apple.com>
+
+ Add an option to Copy WebKit Permalink that automatically opens the URL in the default browser for Sublime Text
+ https://bugs.webkit.org/show_bug.cgi?id=226933
+
+ Reviewed by Tim Horton.
+
+ Usually the step right after copying the permalink is to open a browser and enter it. Having
+ a setting that causes the plugin to do that automatically would save some time and effort.
+
+ * CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py:
+ (Settings.automatically_open_in_browser): Added.
+ (CopyWebKitPermalinkCommand.run):
+ * CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.sublime-settings:
+
2021-06-11 Jonathan Bedard <jbed...@apple.com>
[check-webkit-style] failing in JS checker due to python byte string
Modified: trunk/Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py (278775 => 278776)
--- trunk/Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py 2021-06-11 19:55:13 UTC (rev 278775)
+++ trunk/Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py 2021-06-11 20:02:07 UTC (rev 278776)
@@ -25,6 +25,7 @@
import sublime
import sublime_plugin
import subprocess
+import webbrowser
global s_settings
@@ -52,6 +53,14 @@
def include_revision(self, value):
self._set('include_revision', value)
+ @property
+ def automatically_open_in_browser(self):
+ return self._get('automatically_open_in_browser', default=False)
+
+ @automatically_open_in_browser.setter
+ def automatically_open_in_browser(self, value):
+ self._set('automatically_open_in_browser', value)
+
def _get(self, key, default=None):
if key not in self._cache:
self._settings.add_on_change(key, lambda : self._cache.pop(key, None))
@@ -83,7 +92,10 @@
path = self.path_relative_to_repository_root_for_path(document_path)
revision_info = self.revision_info_for_path(document_path)
- sublime.set_clipboard(self.permalink_for_path(path, line_number, revision_info, annotate_blame))
+ permalink = self.permalink_for_path(path, line_number, revision_info, annotate_blame)
+ sublime.set_clipboard(permalink)
+ if s_settings.automatically_open_in_browser:
+ webbrowser.open(permalink)
def is_enabled(self):
return len(self.view.sel()) > 0 and bool(self.view.file_name())
Modified: trunk/Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.sublime-settings (278775 => 278776)
--- trunk/Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.sublime-settings 2021-06-11 19:55:13 UTC (rev 278775)
+++ trunk/Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.sublime-settings 2021-06-11 20:02:07 UTC (rev 278776)
@@ -1,4 +1,7 @@
{
// Controls whether the SVN revision is included in the URL.
"include_revision": true,
+
+ // Controls whether the URL is automatically opened in the default browser.
+ "automatically_open_in_browser": false,
}
\ No newline at end of file
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes