possan / sublime_unicode_nbsp

A sublime text plugin that highlights unicode characters such as non breakable spaces and others that break compilers/linters
30 stars 17 forks source link

Make the trailing spaces highligthing optional #7

Open k4nar opened 11 years ago

k4nar commented 11 years ago

First, I must thank your for your work. I've been waiting for a plugin like that since a long time. With my keyboard layout (BÉPO), the non-breakable space is inserted with ctrl+space, so I unexpectedly hit it a lot of times in a day.

But my sublime is configured to always cut the trailing spaces at save, so I don't need those to be highlighted. Actually I find this behavior pretty annoying, as it marks every space I type as red.

Would it be possible add an option to disable it ?

AllanLRH commented 10 years ago

I was annoyed by this as well, but it turns out it's easy to disable the trailing space highlight by commenting out two lines in the source code... but if you do this, you'll probably want to install the plugin manually to avoid overwrites due to updates.

Comment out the two lines, which is allreaddy commentet out in this code:

    def update(self, view):
        settings = view.settings()
        color_name = settings.get('highlight_unicode_color_name', DEFAULT_COLOR_NAME)
        regions = []
        for x in view.find_all(u'[' + ''.join(self.chars.keys()) + u']+'):
            regions.append(x)
        # for x in view.find_all(u'[ \t]+$'):
            # regions.append(x)
alepee commented 7 years ago

I just made a pull request for this https://github.com/possan/sublime_unicode_nbsp/pull/15

gardiner commented 4 years ago

This is so funny, I came here only to ask if somebody would be interested in a pull request and now @alepee has already done it - 4 years ago! Thank you :) I wish the project maintainer would apply this pull request...

alepee commented 3 years ago

I think it won't be merged anytime soon..

aaronmader commented 3 years ago

Is there a successor to this package that includes the suggested patch?