Skip to content

Commit a462e55

Browse files
committed
Fix previews not showing in newly opened file
1 parent 0da18c3 commit a462e55

File tree

6 files changed

+11
-33
lines changed

6 files changed

+11
-33
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# ColorHelper
22

3+
## 6.4.3
4+
5+
- **FIX**: Fix issue where a newly opened file will not show previews
6+
until the file is scrolled or resized.
7+
38
## 6.4.2
49

510
- **FIX**: Fix regression in Sublime ColorMod parsing.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 - 2023 Isaac Muse
3+
Copyright (c) 2015 - 2025 Isaac Muse
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

README.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
[![Donate via PayPal][donate-image]][donate-link]
2-
[![Discord][discord-image]][discord-link]
3-
[![Build][github-ci-image]][github-ci-link]
42
[![Package Control Downloads][pc-image]][pc-link]
53
![License][license-image]
64
# ColorHelper
@@ -29,25 +27,6 @@ https://facelessuser.github.io/ColorHelper/
2927

3028
ColorHelper is released under the MIT license.
3129

32-
Copyright (c) 2015 - 2023 Isaac Muse <[email protected]>
33-
34-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
35-
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
36-
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
37-
persons to whom the Software is furnished to do so, subject to the following conditions:
38-
39-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
40-
Software.
41-
42-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
43-
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
44-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
45-
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
46-
47-
[github-ci-image]: https://github.com/facelessuser/ColorHelper/workflows/build/badge.svg?branch=master&event=push
48-
[github-ci-link]: https://github.com/facelessuser/ColorHelper/actions?query=workflow%3Abuild+branch%3Amaster
49-
[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333
50-
[discord-link]: https://discord.gg/TWs8Tgr
5130
[pc-image]: https://img.shields.io/packagecontrol/dt/ColorHelper.svg?labelColor=333333&logo=sublime%20text
5231
[pc-link]: https://packagecontrol.io/packages/ColorHelper
5332
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333

ch_preview.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ def do_search(self, force=False):
358358
)
359359

360360
# If we don't need to force previews,
361-
# quit if visible region is the same as last time
362-
if not force and self.previous_region[view_id] == bounds:
361+
# quit if visible region is the same as last time or there is no region to scan
362+
if (not force and self.previous_region[view_id] == bounds) or visible_region.size() == 0:
363363
return
364364
self.previous_region[view_id] = bounds
365365

@@ -376,7 +376,7 @@ def do_search(self, force=False):
376376
# Get the scan scopes
377377
scanning = rules.get("scanning")
378378
classes = rules.get("color_class", "css-level-4")
379-
if show_preview and visible_region.size() and scanning and classes:
379+
if show_preview and scanning and classes:
380380
# Get out of gamut related options
381381
self.setup_gamut_options()
382382

@@ -884,7 +884,6 @@ def plugin_loaded():
884884
"""Setup plugin."""
885885

886886
global ch_settings
887-
global ch_last_updated
888887

889888
# Setup settings
890889
ch_settings = sublime.load_settings('color_helper.sublime-settings')
@@ -894,9 +893,6 @@ def plugin_loaded():
894893
ch_settings.add_on_change('reload', settings_reload)
895894
settings_reload()
896895

897-
# Start event thread
898-
setup_previews()
899-
900896

901897
def plugin_unloaded():
902898
"""Kill threads."""

mkdocs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repo_url: https://github.com/facelessuser/ColorHelper
44
edit_uri: tree/master/docs/src/markdown
55
site_description: Popup tooltips and previews for stylesheet colors.
66
copyright: |
7-
Copyright &copy; 2015 - 2023 <a href="https://github.com/facelessuser" target="_blank" rel="noopener">Isaac Muse</a>
7+
Copyright &copy; 2015 - 2025 <a href="https://github.com/facelessuser" target="_blank" rel="noopener">Isaac Muse</a>
88
99
docs_dir: docs/src/markdown
1010
theme:
@@ -148,8 +148,6 @@ extra:
148148
social:
149149
- icon: fontawesome/brands/github
150150
link: https://github.com/facelessuser
151-
- icon: fontawesome/brands/discord
152-
link: https://discord.gg/TWs8Tgr
153151

154152
plugins:
155153
- search

support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import webbrowser
66
import re
77

8-
__version__ = "6.4.2"
8+
__version__ = "6.4.3"
99
__pc_name__ = 'ColorHelper'
1010

1111
CSS = '''

0 commit comments

Comments
 (0)