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

Commit d1b84a3

Browse files
Merge pull request #20 from leewillis77/master
Allow URL highlighting to be turned off via a preference. Fixes #1
2 parents d4a3e87 + cf9933d commit d1b84a3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ Anything from [this list](https://docs.python.org/2/library/webbrowser.html#webb
3131
"clickable_urls_browser": "firefox"
3232
}
3333

34+
## Disabling URL highlighting
35+
36+
Unfortunately, the only way to underline a block of text in ST2 is a hack with underlining empty regions, and there is no way to control its appearance. If you want, you can disable URL highlighting by setting the option highlight_urls to false in Preferences > Package Settings > Clickable URLs > Settings - User
37+
38+
{
39+
"highlight_urls": false
40+
}
41+
42+
3443
* * *
3544

3645
By [Leonid Shevtsov](http://leonid.shevtsov.me)

clickable_urls.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ def update_url_highlights(self, view):
4242

4343
UrlHighlighter.urls_for_view[view.id()] = urls
4444

45+
highlight_urls = sublime.load_settings('ClickableUrls.sublime-settings').get('highlight_urls', True)
46+
47+
if (highlight_urls):
48+
self.highlight_urls(view)
49+
50+
def highlight_urls(self, view):
4551
# We need separate regions for each lexical scope for ST to use a proper color for the underline
4652
# TODO someday Sublime Text 3 will support drawing underlines. Then this code could be civilised and de-hacked
4753
scope_map = {}

0 commit comments

Comments
 (0)