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:
Simon Hauser
2020-12-17 09:27:11 +01:00
committed by GitHub
parent b5ff9de13d
commit e5233f39c5
2 changed files with 4 additions and 67 deletions

View File

@@ -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