Skip to content

Commit

Permalink
feat(toc): scroll content to center when previewing
Browse files Browse the repository at this point in the history
  • Loading branch information
champignoom committed Dec 3, 2023
1 parent fe02638 commit 6d7fd13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/neorg/modules/core/qol/toc/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ module.on_event = function(event)
local location = get_target_location_under_cursor(window, previous_buffer)
if location then
vim.api.nvim_win_set_cursor(previous_window, { location[1] + 1, location[2] })
vim.api.nvim_set_current_win(previous_window)
vim.cmd("normal! zz")
vim.api.nvim_set_current_win(window)
end
end
ui_cursor_start_moving = true
Expand Down

0 comments on commit 6d7fd13

Please sign in to comment.