diff --git a/.travis.yml b/.travis.yml index 20cfe517..c30478f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,9 @@ notifications: on_success: never on_failure: change +env: + - ATOM_CHANNEL=nightly + script: 'curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh' git: diff --git a/lib/snippets.js b/lib/snippets.js index 8e67ec0b..a22d03d9 100644 --- a/lib/snippets.js +++ b/lib/snippets.js @@ -11,6 +11,9 @@ const SnippetExpansion = require('./snippet-expansion') const EditorStore = require('./editor-store') const {getPackageRoot} = require('./helpers') +// Used to guess if the snippets file comes from a core package (bundled with Atom) or not +const IS_CORE_PACKAGE = new RegExp(`${_.escapeRegExp(path.sep)}node_modules${_.escapeRegExp(path.sep)}`); + module.exports = { activate () { this.loaded = false @@ -218,7 +221,7 @@ module.exports = { loadPackageSnippets (callback) { const disabledPackageNames = atom.config.get('core.packagesWithSnippetsDisabled') || [] const packages = atom.packages.getLoadedPackages().sort((pack, _) => { - return /\/node_modules\//.test(pack.path) ? -1 : 1 + return IS_CORE_PACKAGE.test(pack.path) ? -1 : 1 }) const snippetsDirPaths = []