Skip to content

Commit

Permalink
Merge pull request #14 from naefl/main
Browse files Browse the repository at this point in the history
Fix whitespace and remove print

Print can be added manually through setting `after_action ` in config (See README)
  • Loading branch information
jvgrootveld authored Sep 12, 2022
2 parents dbd9674 + 3d4a0c1 commit 9fd15a4
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions lua/telescope/_extensions/zoxide/list.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,14 @@ local fuzzy_with_z_score_bias = function(opts)
end

local entry_maker = function(item)
local items = vim.split(string.gsub(item, '^%s*(.-)%s*$', '%1'), " ")
local score = 0
local item_path = item

if #items > 1 then
score = tonumber(items[1])
item_path = items[2]
end
local trimmed = string.gsub(item, '^%s*(.-)%s*$', '%1')
local item_path = string.gsub(trimmed, '^[^%s]* (.*)$', '%1')
local score = tonumber(string.gsub(trimmed, '^([^%s]*) .*$', '%1'), 10)

return {
value = item,
value = item_path,
ordinal = item_path,
display = item,

display = item_path,
z_score = score,
path = item_path
}
Expand All @@ -82,7 +76,6 @@ end
local create_mapping = function(prompt_bufnr, mapping_config)
return function()
local selection = action_state.get_selected_entry()

if mapping_config.before_action ~= nil then
mapping_config.before_action(selection)
end
Expand Down

0 comments on commit 9fd15a4

Please sign in to comment.