Skip to content

feat: improve entry display and add highlighting #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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: 8 additions & 2 deletions lua/telescope-orgmode/entry_maker/headlines.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ M.make_entry = function(opts)
local displayer = entry_display.create({
separator = ' ',
items = {
{ width = vim.F.if_nil(opts.location_width, 20) },
{ width = vim.F.if_nil(opts.location_width, 16) },
{ width = vim.F.if_nil(opts.location_width, 24) },
{ remaining = true },
},
})

---@param entry MatchEntry
local function make_display(entry)
return displayer({ entry.location, entry.tags .. ' ' .. entry.line })
return displayer({
{entry.location, "TelescopeResultsComment"},
{entry.tags, "@org.tag"},
{entry.line, "@org.headline.level"..entry.headline_level},
})
end

return function(entry)
Expand All @@ -66,6 +71,7 @@ M.make_entry = function(opts)
location = location,
line = line,
tags = tags,
headline_level = headline.level
}
end
end
Expand Down
1 change: 0 additions & 1 deletion lua/telescope/_extensions/orgmode/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-- TODO: include headline.level and headline.is_archived() as part of the
-- public orgmode api
-- TODO: add highlight groups

return require('telescope').register_extension({
setup = require('telescope-orgmode').setup,
Expand Down