Fix: Use plenary.filetype.detect and remove own filetype detect (#326)
requires newest plenary.nvim version or you will have a bad day
This commit is contained in:
@@ -56,22 +56,6 @@ path.normalize = function(filepath, cwd)
|
||||
return filepath
|
||||
end
|
||||
|
||||
path.read_last_line = function(filepath)
|
||||
local fd = vim.loop.fs_open(filepath, "r", 438)
|
||||
if fd == nil then return '' end
|
||||
local stat = assert(vim.loop.fs_fstat(fd))
|
||||
local data = ''
|
||||
local index = stat.size - 2
|
||||
while true do
|
||||
local char = assert(vim.loop.fs_read(fd, 1, index))
|
||||
if char == '\n' then break end
|
||||
data = char .. data
|
||||
index = index - 1
|
||||
end
|
||||
assert(vim.loop.fs_close(fd))
|
||||
return data
|
||||
end
|
||||
|
||||
path.read_file = function(filepath)
|
||||
local fd = vim.loop.fs_open(filepath, "r", 438)
|
||||
if fd == nil then return '' end
|
||||
|
||||
Reference in New Issue
Block a user