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(_)
6565
6666 -- Link to a specific heading if is set
6767 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 )
6969 end
7070
7171 org .insert_link (destination )
@@ -83,11 +83,11 @@ function M._find_orgfiles(opts, prompt_bufnr)
8383 M ._update_picker (orgfiles , opts .prompt_titles .orgfiles , prompt_bufnr )
8484end
8585
86- function M ._update_picker (results , title , prompt_bufnr )
86+ function M ._update_picker (finder , title , prompt_bufnr )
8787 local current_picker = action_state .get_current_picker (prompt_bufnr )
8888
8989 current_picker .layout .prompt .border :change_title (title )
90- current_picker :refresh (results )
90+ current_picker :refresh (finder )
9191end
9292
9393return M
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ local function index_headlines(file_results, opts)
2020 file = file_entry .file ,
2121 filename = file_entry .filename ,
2222 headline = headline ,
23- title = nil ,
2423 }
2524 table.insert (results , entry )
2625 end
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ function M.refile(opts)
2828 return OrgApi .refile (opts )
2929end
3030
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+
3137function M .insert_link (destination )
3238 return OrgApi .insert_link (destination )
3339end
Original file line number Diff line number Diff line change 3939--- @field start_col number
4040--- @field end_line number
4141--- @field end_col number
42+ ---
43+ --- @class OrgHeadline
44+ --- @field headline TSNode
45+ --- @field file OrgFile
4246
4347--- @class OrgApiHeadline
4448--- @field title string headline title without todo keyword , tags and priority. Ex. ` * TODO I am a headline :SOMETAG:` returns ` I am a headline`
5963--- @field priority string | nil
6064--- @field is_archived boolean headline marked with the ` :ARCHIVE:` tag
6165--- @field headlines OrgApiHeadline[]
62- --
66+ --- @field id_get_or_create number
67+ --- @field private _section OrgHeadline
68+ --- @field private _index number
69+
6370--- @class OrgApiRefileOpts
6471--- @field source OrgApiHeadline
6572--- @field destination OrgApiFile | OrgApiHeadline
You can’t perform that action at this time.
0 commit comments