1
1
local from_entry = require " telescope.from_entry"
2
- local Path = require " plenary.path "
2
+ local Path = require " plenary.path2 "
3
3
local utils = require " telescope.utils"
4
4
local putils = require " telescope.previewers.utils"
5
5
local Previewer = require " telescope.previewers.previewer"
@@ -98,7 +98,7 @@ color_hash[6] = function(line)
98
98
end
99
99
100
100
local colorize_ls_long = function (bufnr , data , sections )
101
- local windows_add = Path . path . sep == " \\ " and 2 or 0
101
+ local windows_add = utils . iswin and 2 or 0
102
102
for lnum , line in ipairs (data ) do
103
103
local section = sections [lnum ]
104
104
for i = 1 , section [1 ].end_index - 1 do -- Highlight permissions
@@ -125,7 +125,7 @@ local handle_directory_preview = function(filepath, bufnr, opts)
125
125
local set_colorize_lines
126
126
if opts .preview .ls_short then
127
127
set_colorize_lines = function (data , sections )
128
- local PATH_SECTION = Path . path . sep == " \\ " and 4 or 6
128
+ local PATH_SECTION = utils . iswin and 4 or 6
129
129
local paths = {}
130
130
for i , line in ipairs (data ) do
131
131
local section = sections [i ][PATH_SECTION ]
@@ -195,7 +195,7 @@ local handle_file_preview = function(filepath, bufnr, stat, opts)
195
195
end
196
196
197
197
opts .start_time = vim .loop .hrtime ()
198
- Path :new (filepath ):_read_async (vim .schedule_wrap (function (data )
198
+ Path :new (filepath ):read (vim .schedule_wrap (function (data )
199
199
if not vim .api .nvim_buf_is_valid (bufnr ) then
200
200
return
201
201
end
0 commit comments