Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change the highlighting color via highlight_color #161

Open
davidhcefx opened this issue Jan 26, 2024 · 0 comments
Open

Unable to change the highlighting color via highlight_color #161

davidhcefx opened this issue Jan 26, 2024 · 0 comments

Comments

@davidhcefx
Copy link

davidhcefx commented Jan 26, 2024

Description

  • According to your instruction, I should be able to change the highlighting color through the "highlight_color" config.
  • However, setting it to any value failed to work. Including:
    • #fff
    • region.greenish
    • region.yellowish
  • I discovered that every time I invoked Toggle Trailing Spaces Highlight, the config will be overwritten to "highlight_color": "region.redish"
  • It seems that line 371 is doing something nasty.
    • Why do it need to change the user's settings? If it alter the user's settings, can it change it back? What if Sublime were exited before the changes being reverted?

class ToggleTrailingSpacesCommand(sublime_plugin.WindowCommand):
def run(self) -> None:
view = self.window.active_view()
if not view:
return
if max_size_exceeded(view):
sublime.status_message("File is too big, trailing spaces handling disabled.")
return
state = toggle_highlighting(view)
settings.highlight_color = current_highlight_color
settings.save()
sublime.status_message('Highlighting of trailing spaces is %s' % state)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant