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

refactor(api): use keydict and arena for more api return values #27284

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

bfredl
Copy link
Member

@bfredl bfredl commented Feb 1, 2024

Implement api_keydict_to_dict as the complement to api_dict_to_keydict. Along with using arena, this avoids a lot of temporary object allocations when calling api functions from lua.

Fix a conversion error when nvim_get_win_config gets called from lua, where Float values "x" and "y" didn't get converted to lua numbers.

@github-actions github-actions bot added refactor changes that are not features or bugfixes api libnvim, Nvim RPC API labels Feb 1, 2024
@github-actions github-actions bot requested a review from famiu February 1, 2024 11:54
@bfredl bfredl force-pushed the unkeydict branch 4 times, most recently from 4cb9118 to ca2635a Compare February 8, 2024 10:09
Implement api_keydict_to_dict as the complement to api_dict_to_keydict

Fix a conversion error when nvim_get_win_config gets called from lua,
where Float values "x" and "y" didn't get converted to lua numbers.
@bfredl bfredl merged commit 3f2d543 into neovim:master Feb 8, 2024
25 checks passed
@github-actions github-actions bot removed the request for review from famiu February 8, 2024 10:43
pysan3 added a commit to pysan3/nui.nvim that referenced this pull request Feb 14, 2024
`vim.api.nvim_win_get_config` used to return a dict of numbers to
represent a vim float number for `row` and `col` fields.
This behavior was fixed in neovim/neovim#27284
as a **breaking change** to the old API without any notice.
Now user can refer to the value of `config.row` without indexing
like `config.row[vim.val_idx]`.
@wookayin wookayin added this to the 0.10 milestone Feb 14, 2024
MunifTanjim pushed a commit to MunifTanjim/nui.nvim that referenced this pull request Feb 15, 2024
`vim.api.nvim_win_get_config` used to return a dict of numbers to
represent a vim float number for `row` and `col` fields.
This behavior was fixed in neovim/neovim#27284
as a **breaking change** to the old API without any notice.
Now user can refer to the value of `config.row` without indexing
like `config.row[vim.val_idx]`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api libnvim, Nvim RPC API refactor changes that are not features or bugfixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants