Skip to content

Commit 14c3805

Browse files
committed
Tighten vimrc regex
Closes #40
1 parent 3605ba4 commit 14c3805

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

assets/json/pattern.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
".*materialize.*\\.js$": "",
88
".*mootools.*\\.js$": "",
99
".*require.*\\.js$": "",
10-
".*vimrc.*": "",
10+
".*vimrc[^/\\\\]*$": "",
1111
"/Contacts\\.$": "󰉌",
1212
"/Desktop\\.$": "",
1313
"/Downloads\\.$": "󰉍",

test/nerdfont/path/pattern.vimspec

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ Describe nerdfont#path#pattern
1515
Assert Equals(glyph, '')
1616
End
1717

18+
It returns a Vagrant glyph for 'Vagrantfile' stored under a vimrc path
19+
let glyph = nerdfont#path#pattern#find('vimrc-modules/Vagrantfile')
20+
Assert Equals(glyph, '')
21+
End
22+
23+
It returns a Vagrant glyph for 'Vagrantfile' stored under a Windows vimrc path
24+
let glyph = nerdfont#path#pattern#find('vimrc-modules\Vagrantfile')
25+
Assert Equals(glyph, '')
26+
End
27+
28+
It returns a Vim glyph for vimrc patterns
29+
let glyph = nerdfont#path#pattern#find('vimrc-whatever')
30+
Assert Equals(glyph, '')
31+
let glyph = nerdfont#path#pattern#find('.vimrc')
32+
Assert Equals(glyph, '')
33+
End
34+
1835
It returns an empty string for 'hogehogefoobar'
1936
let glyph = nerdfont#path#pattern#find('hogehogefoobar')
2037
Assert Equals(glyph, '')

0 commit comments

Comments
 (0)