Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lua/frecency/entry_maker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,17 @@ function EntryMaker:create(filepath_formatter, workspaces, workspace_tag)
end)

return function(file)
-- Compute ordinal as relative path from workspace to avoid matching workspace name
local ordinal = file.path
if workspaces and #workspaces == 1 then
if file.path:find(workspaces[1], 1, true) == 1 then
ordinal = file.path:sub(#workspaces[1] + 2) -- +2 to skip the path separator
end
end

return {
filename = file.path,
ordinal = file.path,
ordinal = ordinal,
name = file.path,
score = file.score,
---@param entry FrecencyEntry
Expand Down