nvim-treehopper icon indicating copy to clipboard operation
nvim-treehopper copied to clipboard

I want to set a callback to run after the execute

Open yuki-yano opened this issue 3 years ago • 1 comments

When I use hrargs.nvim it highlights where I used the argument, but it remains highlighted when I run treehopper's nodes. https://github.com/m-demare/hlargs.nvim

CleanShot 2022-08-31 at 15 32 07

I have disabled hlargs when using treehopper for fold, but there is no way to enable it after the move. Is it possible to issue a User event after completion or pass a callback when treehopper runs?

" current settings
function! s:tree_hopper_fold() abort
  lua require('hlargs').disable()
  lua require('tsht').nodes()
  normal! zf
endfunction
nmap <silent> zf <Cmd>call <SID>tree_hopper_fold()<CR>

" I want to do this setup.
autocmd User TreeHopperEnter lua require('hlargs').disable()
autocmd User TreeHopperLeave lua require('hlargs').enable()

yuki-yano avatar Aug 31 '22 06:08 yuki-yano

Sounds okay to me to add a callback to the nodes opts. If you want create a PR

mfussenegger avatar Feb 24 '23 12:02 mfussenegger