From f2204952ba670372de507bdd446c6a14f821ac73 Mon Sep 17 00:00:00 2001 From: Munif Tanjim Date: Wed, 26 Oct 2022 12:41:53 +0600 Subject: [PATCH] fix(bar): rename tabnr to tabid in context --- lua/nui/bar/README.md | 2 +- lua/nui/bar/core.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/nui/bar/README.md b/lua/nui/bar/README.md index cc3cce33..c9a4ff5f 100644 --- a/lua/nui/bar/README.md +++ b/lua/nui/bar/README.md @@ -24,7 +24,7 @@ The context table looks like this: ctx?: boolean | number | string | table, bufnr: integer, winid: integer, - tabnr: integer, + tabid: integer, is_focused: boolean } ``` diff --git a/lua/nui/bar/core.lua b/lua/nui/bar/core.lua index 8d5e70b0..9e2a15e8 100644 --- a/lua/nui/bar/core.lua +++ b/lua/nui/bar/core.lua @@ -2,7 +2,7 @@ local mod = {} --luacheck: push no max line length ----@alias nui_bar_core_expression_context { ctx?: boolean|number|string|table, bufnr: integer, winid: integer, tabnr: integer, is_focused: boolean } +---@alias nui_bar_core_expression_context { ctx?: boolean|number|string|table, bufnr: integer, winid: integer, tabid: integer, is_focused: boolean } ---@alias nui_bar_core_click_handler fun(handler_id: integer, click_count: integer, mouse_button: string, modifiers: string, context: nui_bar_core_expression_context):nil ---@alias nui_bar_core_expression_fn fun(context: nui_bar_core_expression_context):string @@ -65,7 +65,7 @@ local function create_expression_context(ctx) ctx = ctx, bufnr = vim.api.nvim_get_current_buf(), winid = vim.api.nvim_get_current_win(), - tabnr = vim.api.nvim_get_current_tabpage(), + tabid = vim.api.nvim_get_current_tabpage(), } context.is_focused = tostring(context.winid) == vim.g.actual_curwin @@ -103,7 +103,7 @@ local function create_generator_context(ctx) ctx = ctx, bufnr = vim.api.nvim_win_get_buf(winid), winid = winid, - tabnr = vim.api.nvim_win_get_tabpage(winid), + tabid = vim.api.nvim_win_get_tabpage(winid), } context.is_focused = winid == vim.api.nvim_get_current_win()