tjdevries / express_line.nvim

WIP: Statusline written in pure lua. Supports co-routines, functions and jobs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing (?) window params in various subscribe functions

OkanEsen opened this issue · comments

Hi TJ,

is there any particular reason the window parameters aren't passed to the callback? :) I kinda need those parameter inside the callbacks, that's why I'm asking.

buf_autocmd (Source):

subscribe.buf_autocmd = function(identifier, au_events, callback)
  return function(_, buffer)
      [...]
      vim.api.nvim_buf_set_var(buffer.bufnr, identifier, callback(nil, buffer) or '')
      [...]
  end
end

user_autocmd (Source):

subscribe.user_autocmd = function(identifier, au_events, callback)
  return function(_, buffer)
      [...]
      _ElUserSubscriptions[au_events][buffer.bufnr] = function(_, callback_buffer)
        [...]
        callback(nil, callback_buffer)
     
      [...]
      vim.api.nvim_buf_set_var(buffer.bufnr, identifier, callback(nil, buffer) or '')
    end
    [...]
  end
end

Awesome plugin, appreciate your work!