File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FirstMate = require 'first-mate'
3
3
Token = require ' ./token'
4
4
fs = require ' fs-plus'
5
5
Grim = require ' grim'
6
+ path = require ' path'
6
7
7
8
# Extended: Syntax class holding the grammars used for tokenizing.
8
9
#
@@ -53,10 +54,9 @@ class GrammarRegistry extends FirstMate.GrammarRegistry
53
54
54
55
getGrammarPathScore : (grammar , filePath ) ->
55
56
return - 1 unless filePath
56
- filePath = filePath .replace (/ \\ / g , ' /' ) if process .platform is ' win32'
57
57
58
- pathComponents = filePath .toLowerCase ().split (' / ' )
59
- pathComponents = pathComponents . concat (pathComponents .pop ().split (' .' ))
58
+ pathComponents = filePath .toLowerCase ().split (path . sep )
59
+ pathComponents . push (pathComponents .pop ().split (' .' )... )
60
60
pathScore = - 1
61
61
62
62
fileTypes = grammar .fileTypes
You can’t perform that action at this time.
0 commit comments