csscomb / sublime-csscomb

Sublime plugin for CSScomb—CSS coding style formatter
398 stars 62 forks source link

Alert when running CSScomb on invalid syntax #66

Open powelski opened 8 years ago

powelski commented 8 years ago

CSScomb displays an alert whenever it's being ran on invalid syntax. This is really annoying when the alert window pops out when I run it when having some random text selected. Perhaps information in the status bar would be less interrupting?

CSScomb error:
/Users/me/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/lib/options/eof-newline.js:16
            if (lastChild[0] !== 's') {
                         ^
TypeError: Cannot read property '0' of undefined
    at module.exports.process (/Users/me/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/lib/options/eof-newline.js:16:26)
    at /Users/me/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:206:21
    at Array.forEach (native)
    at processNode (/Users/me/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:202:14)
    at /Users/me/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:189:13
    at Array.forEach (native)
    at processTree (/Users/me/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:188:19)
    at processString (/Users/me/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:415:16)
    at Socket.<anonymous> (/Users/me/Library/Application Support/Sublime Text 3/Packages/CSScomb/csscomb.js:28:37)
    at Socket.emit (events.js:129:20)
powelski commented 8 years ago

What is the status of this issue? I think selections could be disabled at all for .css, .scss and .less files. Or, if we want to keep partial combing, those selections could evaluate whether it's CSS block or just a random selection.