lualine.nvim icon indicating copy to clipboard operation
lualine.nvim copied to clipboard

Bug: on_click option not working in components 'buffers' and 'tabs'

Open treequin opened this issue 2 years ago • 1 comments

Self Checks

  • [X] I'm using the latest lualine.
  • [X] I didn't find the issue in existing issues or PRs.

How to reproduce the problem

  1. Click on the mode component. "on_click works" is echoed.
  2. Click on the buffers component. Nothing is echoed.
  3. Click on the tabs component. Nothing is echoed.

Expected behaviour

on_click works when used in buffers and tabs.

Actual behaviour

on_click works in other components, but no in these.

Minimal config to reproduce the issue

call plug#begin("/home/usuario/lualine-bug/.local/share/nvim/plugged")
Plug 'nvim-lualine/lualine.nvim'
call plug#end()

lua << END
require'lualine'.setup {
sections = {
        lualine_a = {
            {
                'mode',
                on_click = function()
                    vim.cmd('echo "on_click works"')
                end,
            },
        },
    },
tabline = {
        lualine_a = {
            {
                'buffers',
                on_click = function()
                vim.cmd('echo "on_click does not work"')
                end,
            },

        },
        lualine_z = {
            {
                'tabs',

                on_click = function()
                vim.cmd('echo "on_click does not work"')
                end,
            },
        },
    },
}
END

Additional information

Tested on latest stable (v0.9.5) and latest nightly (v0.10.0-dev-2830+g541c2d381).

treequin avatar Apr 08 '24 13:04 treequin

Hi, Is there any updates here? I have met the same problem.

OliverChao avatar Aug 05 '25 02:08 OliverChao