mirror of
https://codeberg.org/FelipeLema/cmp-async-path
synced 2025-05-11 20:29:16 +00:00
feat: syntax highlighting in preview (#36)
This commit is contained in:
parent
466b6b8270
commit
222ac1ce7e
@ -9,7 +9,6 @@ local constants = {
|
||||
max_lines = 20,
|
||||
}
|
||||
|
||||
|
||||
---@class cmp_path.Options
|
||||
---@field public trailing_slash boolean
|
||||
|
||||
@ -114,7 +113,7 @@ local function lines_from(file, count)
|
||||
if first_k:find('\0') then
|
||||
return {'binary file'}
|
||||
end
|
||||
local lines = {'```'}
|
||||
local lines = {'```' .. vim.filetype.match { filename = file }}
|
||||
for line in first_k:gmatch("[^\r\n]+") do
|
||||
lines[#lines + 1] = line
|
||||
if count ~= nil and #lines >= count then
|
||||
|
Loading…
Reference in New Issue
Block a user