jinh0 / eyeliner.nvim

👀 Move faster with unique f/F indicators.
461 stars 15 forks source link

Lazy loading on `t`/`T`/`f`/`F` stopped working #53

Closed mawkler closed 2 months ago

mawkler commented 3 months ago

Following up the discussion in https://github.com/jinh0/eyeliner.nvim/issues/46. Here's a minimal config with the lazy loading issue:

Click to expand ```lua local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then vim.fn.system({ 'git', 'clone', '--filter=blob:none', 'https://github.com/folke/lazy.nvim.git', '--branch=stable', -- latest stable release lazypath, }) end vim.opt.rtp:prepend(lazypath) vim.keymap.set('n', '', vim.cmd.quit) vim.api.nvim_set_hl(0, 'LeapBackdrop', { link = 'Comment' }) local mode = { 'n', 'x', 'o' } require('lazy').setup({ 'jinh0/eyeliner.nvim', keys = { { 't', mode = mode }, { 'T', mode = mode }, { 'f', mode = mode }, { 'F', mode = mode }, }, opts = { highlight_on_key = true, } }) ```

The key mappings don't get created after lazy loading on t/T/f/F. I seeem to have to switch to another buffer and back for the key mappings to appear.

jinh0 commented 2 months ago

Hey @mawkler , I believe I've fixed it! Turns out I forgot to enable eyeliner keybinds on setup, it was only enabling keybinds on the BufEnter autocommand. It's fixed in the latest commit 4e2b4bde4edcfbadee1d0a9245c2bebfc58b6003 . latest commit 587c096de0cc3e97ae0993b5b7b9da9b64f72cd4 .

Let me know if it works!

mawkler commented 2 months ago

Nice catch! It seems to work for me. Thank you! 🙂