Revert "fix: support overwrite when merge config. (#1394)"#1404
Conversation
This reverts commit 7056741. Sorry for the noise but I'm a lil confused about this new option...? Like idk if the performance difference between these two is even that big, and maybe it's not actually working as expected?
|
|
But I think this might break some users' expectations of the loader right 🤔 Also think I mentioned |
|
Marking a option as nil is not enough, overwrite is an irreplaceable way to acheive delete and re-define. |
😭 srry if I wasn't super clear earlier! What I meant was we could let users pass vim.NIL *vim.NIL*
Special value representing NIL in |RPC| and |v:null| in Vimscript
conversion, and similar cases. Lua `nil` cannot be used as part of a Lua
table representing a Dictionary or Array, because it is treated as
missing: `{"foo", nil}` is the same as `{"foo"}`.To break it down, imagine the original table looks like this: local orig = {
top = {
middle = {
opt = "OKAY SOME OPTIONS",
whatever = "BLA"
}
}
}And the user's override is like this: local override = {
top = {
middle = vim.NIL,
},
}Now, when we call our {
top = {
middle = vim.NIL
}
}Then all we need to do is strip out the |
My real motivation for introducing this change is NOT to make a part of default configuration be nil, but to use the user's configuration to replace the part of default configuration. For this example,
The reason why I introduce it by adding a parameter to Of course, the replace function can be impl by using return a function to achieve this, but it needs lots of redundant code. |
|
This option is useful for |
oh lol my bad I think I got what u meant now, srry for the confusion! I think passing a function as the value for that key should do the trick right? since it's our first branch it should def be respected |
It's OK. |

This reverts commit 7056741.
Sorry for the noise but I'm a lil confused about this new option...? Like idk if the performance difference between these two is even that big, and maybe it's not actually working as expected?