Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve typing for scoped variables #163

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevearc
Copy link

Problem:

Seeing diagnostic warnings about undefined field when accessing window/buffer/tab scoped variables

vim.w.my_window_var   -- Undefined field `my_window_var`.

Solution:

More correct type definition for vim.b/w/t that accounts for the raw (non-numeric) variable access. This uses the @field annotation syntax to describe all keys of a certain type (detailed here)

@solson
Copy link

solson commented Nov 1, 2023

+1, I just ran into this when using vim.b.term_title and came to check for a bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants