itchyny/lightline.vim

`component_function` does not accept vim9 function

Song-Tianxiang opened this issue · 1 comments

how to reproduce:

vim9script

g:lightline = {
  active: {
    left: [
      [ 'mode', 'paste' ],
      [ 'readonly', 'filename', 'modified' ],
    ],
    right: [
      [ 'position', ],
      [ 'hello', ],
    ],
  },
  component: {
    position: '%P:%L',
  },
  component_function: {
    hello: 'Hello',
  },
}

def Hello(): string
  return 'hello'
enddef

I have defined Hello() function just return 'hello' for test, but it not show up in statusline after reopen vim.
Does component_function can accept a vim9 function or not?

You need to declare as a global function like def g:Hello().