Skip to content

Commit

Permalink
fix(bar): rename tabnr to tabid in context
Browse files Browse the repository at this point in the history
  • Loading branch information
MunifTanjim committed Oct 26, 2022
1 parent 35758e9 commit f220495
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lua/nui/bar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```
Expand Down
6 changes: 3 additions & 3 deletions lua/nui/bar/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit f220495

Please sign in to comment.