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 #20 from leewillis77/master
Browse files Browse the repository at this point in the history
Allow URL highlighting to be turned off via a preference. Fixes #1
  • Loading branch information
leonid-shevtsov committed Aug 14, 2014
2 parents d4a3e87 + cf9933d commit d1b84a3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ Anything from [this list](https://docs.python.org/2/library/webbrowser.html#webb
"clickable_urls_browser": "firefox"
}

## Disabling URL highlighting

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

{
"highlight_urls": false
}


* * *

By [Leonid Shevtsov](http://leonid.shevtsov.me)
Expand Down
6 changes: 6 additions & 0 deletions clickable_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ def update_url_highlights(self, view):

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

highlight_urls = sublime.load_settings('ClickableUrls.sublime-settings').get('highlight_urls', True)

if (highlight_urls):
self.highlight_urls(view)

def highlight_urls(self, view):
# We need separate regions for each lexical scope for ST to use a proper color for the underline
# TODO someday Sublime Text 3 will support drawing underlines. Then this code could be civilised and de-hacked
scope_map = {}
Expand Down

0 comments on commit d1b84a3

Please sign in to comment.