Skip to content

Reactivating hlslens after scroll with mini.animate #460

Closed Answered by echasnovski
simonmandlik asked this question in Q&A
Discussion options

You must be logged in to vote

Executing something after animation is done admittedly is not a very strong side of 'mini.animate'. Especially when it comes to UI.

For some functions (like prev_hunk() and next_hunk() from 'lewis6991/gitsigns.nvim') I found that deferring function by small number of milliseconds improves experience.

Try this "more Lua" version of this code:

require('hlslens').setup({ virt_priority = 0, calm_down = true })

local executing_normal_jump = function(keys)
  local hlslens_start = require('hlslens').start
  return function()
    vim.cmd('normal! ' .. vim.v.count1 .. keys)
    if MiniAnimate == nil then return hlslens_start() end
    MiniAnimate.execute_after('scroll', function() vim.defer_fn(hl…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by simonmandlik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants