MiguelCastillo / Brackets-InteractiveLinter

Interactive linting for Brackets
Other
119 stars 26 forks source link

Fix status icon for HTMLHint and CSSLint when there are no problems. #128

Closed Mooninaut closed 9 years ago

Mooninaut commented 9 years ago

The HTMLHint and CSSLint main functions return a 0-length array when there are no problems. This causes the status icon to show the yellow "warning" sign, but the tooltip to indicate that there are 0 problems.

brackets-interactivelinter-warning-0-problems

I added checks for this condition to both plugins.

MiguelCastillo commented 9 years ago

This is a great find. But I think we are probably better off checking in lintIndicator itself so that plugins arent concerned with the fact that en empty array and not retuning has a different behavior.

We can probably do the change right here https://github.com/MiguelCastillo/Brackets-InteractiveLinter/blob/master/lintIndicator.js#L61

Basically check change the check to

        if (messages && messages.length) {
            setStatus(INDICATOR_STATUS.WARNING);
            $statusBarIndicator.attr('title', StringUtils.format(INDICATOR_TOOLTIPS.WARNING, messages.length));
        }
        else {
            setStatus(INDICATOR_STATUS.OK);
            $statusBarIndicator.attr('title', INDICATOR_TOOLTIPS.OK);
        }
MiguelCastillo commented 9 years ago

Fixed with https://github.com/MiguelCastillo/Brackets-InteractiveLinter/pull/130

Mooninaut commented 9 years ago

I'll be out for a few hours, I'll test it as soon as I get back to my computer. Thanks!