We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a0d3bf commit 2ae1818Copy full SHA for 2ae1818
1 file changed
lua/plenary/filetype.lua
@@ -119,12 +119,14 @@ filetype.detect_from_extension = function(filepath)
119
end
120
121
filetype.detect_from_name = function(filepath)
122
- filepath = filepath:lower()
123
- local split_path = vim.split(filepath, os_sep, true)
124
- local fname = split_path[#split_path]
125
- local match = filetype_table.file_name[fname]
126
- if match then
127
- return match
+ if filepath then
+ filepath = filepath:lower()
+ local split_path = vim.split(filepath, os_sep, true)
+ local fname = split_path[#split_path]
+ local match = filetype_table.file_name[fname]
+ if match then
128
+ return match
129
+ end
130
131
return ""
132
0 commit comments