diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2020-12-17 15:58:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-17 15:58:38 +0100 |
| commit | f078d149a1cfb9e98d9be400b6660dbaa6a58ce9 (patch) | |
| tree | eec5f8ee58e6939ebd5331c3e0b03598731a079f /lua/telescope/path.lua | |
| parent | e5233f39c50b723c562e6a6390ecf46b0237be68 (diff) | |
Update autocmd, highlights and help_tags previewers (#332)
Also make vim buffer line configurable
Diffstat (limited to 'lua/telescope/path.lua')
| -rw-r--r-- | lua/telescope/path.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lua/telescope/path.lua b/lua/telescope/path.lua index 1630ae7..972974e 100644 --- a/lua/telescope/path.lua +++ b/lua/telescope/path.lua @@ -60,6 +60,7 @@ path.read_file = 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)) + if stat.type ~= 'file' then return '' end local data = assert(vim.loop.fs_read(fd, stat.size, 0)) assert(vim.loop.fs_close(fd)) return data @@ -70,6 +71,7 @@ path.read_file_async = function(filepath, callback) assert(not err_open, err_open) vim.loop.fs_fstat(fd, function(err_fstat, stat) assert(not err_fstat, err_fstat) + if stat.type ~= 'file' then return callback('') end vim.loop.fs_read(fd, stat.size, 0, function(err_read, data) assert(not err_read, err_read) vim.loop.fs_close(fd, function(err_close) |
