File tree Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ function M.insert(_)
65
65
66
66
-- Link to a specific heading if is set
67
67
if entry .value .headline then
68
- destination = ' file: ' .. entry .value .file . filename .. ' ::* ' .. entry . value . headline . title
68
+ destination = org . get_link_to_headline ( entry .value .headline )
69
69
end
70
70
71
71
org .insert_link (destination )
@@ -83,11 +83,11 @@ function M._find_orgfiles(opts, prompt_bufnr)
83
83
M ._update_picker (orgfiles , opts .prompt_titles .orgfiles , prompt_bufnr )
84
84
end
85
85
86
- function M ._update_picker (results , title , prompt_bufnr )
86
+ function M ._update_picker (finder , title , prompt_bufnr )
87
87
local current_picker = action_state .get_current_picker (prompt_bufnr )
88
88
89
89
current_picker .layout .prompt .border :change_title (title )
90
- current_picker :refresh (results )
90
+ current_picker :refresh (finder )
91
91
end
92
92
93
93
return M
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ local function index_headlines(file_results, opts)
20
20
file = file_entry .file ,
21
21
filename = file_entry .filename ,
22
22
headline = headline ,
23
- title = nil ,
24
23
}
25
24
table.insert (results , entry )
26
25
end
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ function M.refile(opts)
28
28
return OrgApi .refile (opts )
29
29
end
30
30
31
+ --- @param headline OrgApiHeadline
32
+ --- @return string
33
+ function M .get_link_to_headline (headline )
34
+ return OrgApi .get_link_to_headline (headline ._section ) --- @diagnostic disable-line : invisible
35
+ end
36
+
31
37
function M .insert_link (destination )
32
38
return OrgApi .insert_link (destination )
33
39
end
Original file line number Diff line number Diff line change 39
39
--- @field start_col number
40
40
--- @field end_line number
41
41
--- @field end_col number
42
+ ---
43
+ --- @class OrgHeadline
44
+ --- @field headline TSNode
45
+ --- @field file OrgFile
42
46
43
47
--- @class OrgApiHeadline
44
48
--- @field title string headline title without todo keyword , tags and priority. Ex. ` * TODO I am a headline :SOMETAG:` returns ` I am a headline`
59
63
--- @field priority string | nil
60
64
--- @field is_archived boolean headline marked with the ` :ARCHIVE:` tag
61
65
--- @field headlines OrgApiHeadline[]
62
- --
66
+ --- @field id_get_or_create number
67
+ --- @field private _section OrgHeadline
68
+ --- @field private _index number
69
+
63
70
--- @class OrgApiRefileOpts
64
71
--- @field source OrgApiHeadline
65
72
--- @field destination OrgApiFile | OrgApiHeadline
You can’t perform that action at this time.
0 commit comments