Skip to content

Commit a73d9b7

Browse files
cvigilvseflue
authored andcommitted
feat: improve entry display and add highlighting
- Adjusted width of location and tags columns - Added separate column for tags - Implemented syntax highlighting for different parts of the entry - Added headline level to the entry object for use in highlighting - Modified make_display function to use the new structure and highlighting
1 parent 2cd2ea7 commit a73d9b7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lua/telescope-orgmode/entry_maker/headlines.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,19 @@ M.make_entry = function(opts)
3939
local displayer = entry_display.create({
4040
separator = ' ',
4141
items = {
42-
{ width = vim.F.if_nil(opts.location_width, 20) },
42+
{ width = vim.F.if_nil(opts.location_width, 16) },
43+
{ width = vim.F.if_nil(opts.location_width, 24) },
4344
{ remaining = true },
4445
},
4546
})
4647

4748
---@param entry MatchEntry
4849
local function make_display(entry)
49-
return displayer({ entry.location, entry.tags .. ' ' .. entry.line })
50+
return displayer({
51+
{entry.location, "TelescopeResultsComment"},
52+
{entry.tags, "@org.tag"},
53+
{entry.line, "@org.headline.level"..entry.headline_level},
54+
})
5055
end
5156

5257
return function(entry)
@@ -66,6 +71,7 @@ M.make_entry = function(opts)
6671
location = location,
6772
line = line,
6873
tags = tags,
74+
headline_level = headline.level
6975
}
7076
end
7177
end

lua/telescope/_extensions/orgmode/init.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
-- TODO: include headline.level and headline.is_archived() as part of the
22
-- public orgmode api
3-
-- TODO: add highlight groups
43

54
return require('telescope').register_extension({
65
setup = require('telescope-orgmode').setup,

0 commit comments

Comments
 (0)