Files
HorlogeSkynet 769b2b7f3a break: renames internal files and commands for OOTB ST3/4 compatibility
Due to Sublime Text v4 new snake case converter, commands require to eventually be renamed.
`c_dNUpdates` becomes `cdn_updates`. This change is breaking any other plugin or macro actually
using the previous name.

Closes: #1
2026-10-26 22:29:51 +01:00

35 lines
1.2 KiB
Python

"""CDNUpdates' utils module"""
from sublime import active_window, load_settings
def clear_view(view):
"""Removes the passed `view` object all traces of our elements (known identifiers)"""
if view:
# We just remove each regions containing icons in the gutter...
view.erase_regions('up_to_date')
view.erase_regions('to_update')
view.erase_regions('not_found')
# ... and our phantoms objects containing the latest versions...
view.erase_phantoms('latest_versions')
# ... and "specify version" advices...
view.erase_phantoms('specify_versions')
# ... and "specify HTTPS" advices.
view.erase_phantoms('specify_https')
def log_message(message):
"""When debug mode is enabled in configuration, logs the passed message in the console"""
if load_settings('CDNUpdates.sublime-settings').get('debug', False):
if active_window().active_panel() != 'console':
active_window().run_command(
'show_panel',
{
'panel': 'console',
'toggle': True
}
)
print("[DEBUG] CDNUpdates : {0}".format(message))