File tree Expand file tree Collapse file tree 2 files changed +16
-23
lines changed Expand file tree Collapse file tree 2 files changed +16
-23
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,7 @@ end_of_line = lf
7
7
[* .lua ]
8
8
indent_style = space
9
9
indent_size = 2
10
+
11
+ [* .sh ]
12
+ indent_style = space
13
+ indent_size = 2
Original file line number Diff line number Diff line change 3
3
# Iterate over the elements of icons_by_file_extension and check if there are missed filetypes.
4
4
# $VIMRUNTIME specifies neovim runtime path, defaults to "/usr/share/nvim/runtime" if unset.
5
5
6
- if [ -z " ${VIMRUNTIME} " ]; then
7
- export VIMRUNTIME=" /usr/share/nvim/runtime"
8
- fi
6
+ : " ${VIMRUNTIME:=/ usr/ share/ nvim/ runtime} "
9
7
10
8
exit_value=0
11
- in_section=false
12
9
13
- while IFS= read -r line; do
14
- if [[ $line =~ ^local\ icons_by_file_extension\ = \ \{ $ ]]; then
15
- in_section=true
16
- elif [[ $line =~ ^\} $ ]]; then
17
- in_section=false
18
- fi
10
+ while read -r key; do
11
+ # Search for the key in the main file
12
+ line=$( grep -F " \" $key \" " " lua/nvim-web-devicons.lua" )
13
+ if [ -z " $line " ]; then
14
+ [ -f " ${VIMRUNTIME} /syntax/$key .vim" ] &&
15
+ echo -e " \e[33mPlease add \" $key \" to filetypes Lua table.\e[0m" &&
16
+ exit_value=1
17
+ fi
18
+ done < <(
19
+ sed -nr ' /^local icons_by_file_extension/,/^}/!d; s/.*\["(.*)"\].*/\1/p' lua/nvim-web-devicons/icons-default.lua
20
+ )
19
21
20
- if $in_section && [[ $line =~ \[\" (.+)\"\] ]]; then
21
- key=" ${BASH_REMATCH[1]} "
22
- # Search for the key in the main file
23
- line=$( grep -F " \" $key \" " " lua/nvim-web-devicons.lua" )
24
- if [ -n " $line " ]; then
25
- continue
26
- else
27
- [ -f " ${VIMRUNTIME} /syntax/$key .vim" ] &&
28
- echo -e " \e[33mPlease add \" $key \" to filetypes Lua table.\e[0m" &&
29
- exit_value=1
30
- fi
31
- fi
32
- done < " lua/nvim-web-devicons/icons-default.lua"
33
22
exit $exit_value
You can’t perform that action at this time.
0 commit comments