Problem: Comparing functions and partials doesn't work well.
Solution: Add tests. (Nikolai Pavlov) Compare the dict and arguments in the
partial.
8e759ba865
Problem: When using a partial on a dictionary it always gets bound to that
dictionary.
Solution: Make a difference between binding a function to a dictionary
explicitly or automatically.
1d429610bf
Problem: Leaking memory when there is a cycle involving a job and a
partial.
Solution: Add a copyID to job and channel. Set references in items referred
by them. Go through all jobs and channels to find unreferenced
items. Also, decrement reference counts when garbage collecting.
107e1eef1d
Problem: Double free when a partial is in a cycle with a list or dict.
(Nikolai Pavlov)
Solution: Do not free a nested list or dict used by the partial.
ddecc25947
Problem: When a dict contains a partial it can't be redefined as a
function. (Nikolai Pavlov)
Solution: Remove the partial when overwriting with a function.
c5fbe8af4c
Problem: When binding a function to a dict the reference count is wrong.
Solution: Decrement dict reference count, only reference the function when
actually making a copy. (Ken Takata)
e4eb6ff089
Problem: Comparing a function that exists on two dicts is not backwards
compatible. (Thinca)
Solution: Only compare the function, not what the partial adds.
f0e86a0dbd
Problem: Having type() handle a Funcref that is or isn't a partial
differently causes problems for existing scripts.
Solution: Make type() return the same value. (Thinca)
953cc7fb13
Problem: Get E923 when using function(dict.func, [], dict). (Kent Sibilev)
Storing a function with a dict in a variable drops the dict if the
function is script-local.
Solution: Translate the function name. Use dict arg if present.
6f2e4b36c9
Problem: Using ":call dict.func()" where the function is a partial does
not work. Using "dict.func()" where the function does not take a
Dictionary does not work.
Solution: Handle partial properly in ":call". (Yasuhiro Matsumoto)
65639032bb
Previously, free_oldval was set immediately on entering
did_set_string_option. However, opt_idx hadn't been adjusted to account
for diverting 'viminfo' manipulation to 'shada'.
Therefore, the code which determines whether to free the old value was
looking at the flags for 'viminfo' while the code which sets whether a
value was allocated was modifying the flags for 'shada'. This led to a
leak of any values set for 'viminfo'.
Updating free_oldval once opt_idx has been adjusted for the
'viminfo'/'shada' handling ensures the check/set values are consistent.
Closes#5698