Skip to content

Commit 72d48c6

Browse files
refactor: Capture (#670)
* refactor: Move capture template compiling to template class * refactor: Capture
1 parent ec502be commit 72d48c6

File tree

14 files changed

+594
-515
lines changed

14 files changed

+594
-515
lines changed

lua/orgmode/agenda/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function Agenda:reset()
184184
end
185185

186186
function Agenda:redo(preserve_cursor_pos)
187-
self.files:load():next(vim.schedule_wrap(function()
187+
self.files:load(true):next(vim.schedule_wrap(function()
188188
local cursor_view = nil
189189
if preserve_cursor_pos then
190190
cursor_view = vim.fn.winsaveview() or {}

lua/orgmode/api/init.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,20 @@ function OrgApi.refile(opts)
7272
end
7373

7474
local refile_opts = {
75-
item = opts.source._section,
76-
lines = opts.source._section:get_lines(),
75+
source_file = opts.source._section.file,
76+
source_headline = opts.source._section,
7777
}
7878

7979
if is_file then
80-
refile_opts.file = opts.destination.filename
80+
refile_opts.destination_file = opts.destination._file
8181
else
82-
refile_opts.file = opts.destination.file.filename
83-
refile_opts.headline = opts.destination.title
82+
refile_opts.destination_file = opts.destination._section.file
83+
refile_opts.destination_headline = opts.destination._section
8484
end
85+
8586
local source_bufnr = vim.fn.bufnr(opts.source.file.filename) or -1
8687

87-
orgmode.capture:_refile_to(refile_opts)
88+
orgmode.capture:process_refile(refile_opts)
8889

8990
if source_bufnr > -1 and vim.b[source_bufnr].org_capture then
9091
orgmode.capture:kill()

0 commit comments

Comments
 (0)