Skip to content

Unable to change the highlighting color via highlight_color #161

Description

@davidhcefx

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions