Comments (6)
Fixed by #27284
from neovim.
That reasoning is incorrect tho, for the reasons I already mentioned. The type of a float position was intentionally chosen to be a number, not a foreign object of an unknown type. Neither is a "special case" of the other, it is just two different code paths which has always existed (and we fixed bugs like this multiple times in the past)
from neovim.
add a notice to the documentation of the functions that may have lua-special-tbl in the return value about how the return value may contain lua-special-tbl
That is all functions that can return a dict.
make it so that inspecting a lua-special-tbl would not return the table with boolean keys, but either a string similar to
vim.empty_dict()
, or the table with the keys beingvim.type_idx
andvim.val_idx
instead oftrue
andfalse
Do you mean vim.inspect()
?
from neovim.
For the documentation, what I thought of was for those functions that would, if not for vim-script compatibility reasons, return a normal number/table, but because of vim-script compatibility, return a lua-special-tbl (or returns a table that contains a lua-special-tbl).
For the inspection, mostly yes: I would also want to include tostring, but I don't know how feasible it is to set metatable.__tostring for lua-special-tbl.
from neovim.
Some functions, like nvim_win_get_config, have a lua-special-tbl float in the returned values, but what the user sees when inspecting it is a table with the keys true and false set to some numbers, which is confusing.
Hmm in this particular case it is a bug. There is no "compat" going on here but vim.api.nvim_win_get_config()
is a native API call. And as the type of row/col is an hard-coded Float, not a free Object, it should always be represented by a lua number (i e row=2 and row=2.0 is the same value already in the API layer)
Special dicts for numbers are only for cases where 2
as an int and 2.0
as a float are different as values, i e when representing foreign type systems.
from neovim.
The behavior of vim.api.nvim_win_get_config()
returning lua-special-tbl being a bug was already brought up, and marked as intended behavior (#24430 (comment))
from neovim.
Related Issues (20)
- Blockwise deletion with charwise choice (i.e. dva}) misses last brace HOT 3
- tutor tests become unresponsive on line-number mismatch HOT 9
- tutor: raw text not shown while editing element HOT 7
- Certain flag emoji don't render correctly HOT 4
- Consider adding diagnostics display toggle HOT 3
- fswatch-limitation not found with `:h fswatch-limitation` HOT 2
- Neovim used as git editor freezes when typing commit message HOT 5
- `vim.diagnostic.count` sometimes returns a list
- <C-u> doesn't scroll half of the screen when there are closed folds HOT 11
- `nvim_buf_call` restores window-local current directory incorrectly HOT 1
- It suddenly crashed when I pressed the keybinding for :w! HOT 1
- :checkhealth unclear output HOT 6
- E5108: Error executing lua: ~/.config/nvim/init.lua:86: attempt to index field 'inlay_hint' (a nil value) HOT 1
- Commenting prioritizes treesitter injected languages' filetypes' `'commentstring'`, which may be incorrect HOT 2
- Relative floating window rendered on wrong tab page HOT 5
- [Feature request] Make t motion match self closed tags HOT 3
- <C-u>zz does not work on the last line, when the last line is centered, and `scrollof` set to value >0 HOT 1
- C-d and C-u don't move the cursor half the page when viewport collides with the start/end of the file HOT 3
- typst syntax HOT 1
- LSP: configure inlay hint visualization position HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neovim.