Skip to content

Commit

Permalink
fix(agenda): Do not jump cursor to first line
Browse files Browse the repository at this point in the history
  • Loading branch information
kristijanhusak committed Jan 28, 2025
1 parent f7c669a commit 271a6fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lua/orgmode/agenda/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ function Agenda:render()
vim.w.org_window_pos = nil
end
end

if #self.views > 1 then
vim.fn.cursor({ 1, 0 })
end
end

function Agenda:agenda(opts)
Expand Down Expand Up @@ -174,7 +170,11 @@ function Agenda:_build_custom_commands()
table.insert(views, AgendaTypes[agenda_type.type]:new(opts))
end
self.views = views
return self:prepare_and_render()
return self:prepare_and_render():next(function()
if #self.views > 1 then
vim.fn.cursor({ 1, 0 })
end
end)
end,
})
end
Expand Down

0 comments on commit 271a6fa

Please sign in to comment.