Commit Graph

7060 Commits

Author SHA1 Message Date
Justin M. Keyes
43ba7f4d98 eval.c: set_selfdict(): Fix invalid memory access. 2016-12-14 20:52:18 +01:00
James McCoy
966be42a2b
shada: Move '%' handling from shada_write to its own function
shada_get_buflist finds all the relevant buffers and generates the
kSDItemBufferList ShadaEntry.
2016-12-14 06:56:48 -05:00
James McCoy
8c9cccbcb6 Merge pull request #5760 from jamessan/shada-percent-count
shada: Respect the optional buffer count for shada-%
2016-12-13 22:35:25 -05:00
Marco Hinz
5855f30cb1 Make VimL code compatible with merged Partial support (#5765)
Closes #5763.
2016-12-13 14:48:42 +01:00
James McCoy
dbe41fe310 Merge pull request #5764 from jamessan/get-vim-patch
vim-patch: Add -g switch to download/preprocess patch
2016-12-13 08:39:47 -05:00
James McCoy
c6bd9f525c
vim-patch: Add -g switch to download/preprocess patch 2016-12-12 20:55:25 -05:00
James McCoy
7eb91c781b shada: Respect the optional buffer count for shada-%
Closes #5759
2016-12-12 14:35:09 -05:00
James McCoy
988ab5804a Merge pull request #5529 from brcolow/vim-7.4.1559
Port partial patches from vim
2016-12-12 10:53:32 -05:00
Michael Ennen
5e4eb18eb0 Add some tests and cleanup. 2016-12-12 10:17:35 -05:00
Björn Linse
0f681c80e1 Make partials work with jobs, timers, and dictwatchers. 2016-12-12 10:17:35 -05:00
Michael Ennen
a21c687661 Fixes. 2016-12-12 10:17:35 -05:00
Michael Ennen
2c4e92abea vim-patch:7.4.1731 Mark as NA
Leave a note in vim_diff.txt about it.
2016-12-12 10:17:35 -05:00
Michael Ennen
6c5dd6827f vim-patch:7.4.1875
Problem:    Comparing functions and partials doesn't work well.
Solution:   Add tests. (Nikolai Pavlov)  Compare the dict and arguments in the
            partial.

8e759ba865
2016-12-12 10:17:35 -05:00
Michael Ennen
b42347da45 vim-patch:7.4.1862 Mark as NA 2016-12-12 10:17:35 -05:00
Michael Ennen
537cee4883 vim-patch:7.4.1860
Problem:    Using a partial for timer_start() may cause a crash.
Solution:   Set the copyID in timer objects. (Ozaki Kiichi)

e3188e2615
2016-12-12 10:17:35 -05:00
Michael Ennen
c52856af2c vim-patch:7.4.1842
Problem:    get() works for Partial but not for Funcref.
Solution:   Accept Funcref.  Also return the function itself. (Nikolai Pavlov)

03e19a04ac
2016-12-12 10:17:35 -05:00
Michael Ennen
02c58d8a07 vim-patch:7.4.1839
Problem:    Cannot get the items stored in a partial.
Solution:   Support using get() on a partial.

2bbf8eff6f
2016-12-12 10:17:35 -05:00
Michael Ennen
c82dc7a6fd vim-patch:7.4.1836
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
2016-12-12 10:17:35 -05:00
Michael Ennen
eb337c9949 vim-patch:7.4.1720 Mark as NA 2016-12-12 10:17:35 -05:00
Michael Ennen
25438f149f vim-patch:7.4.1719
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
2016-12-12 10:17:35 -05:00
Michael Ennen
e97e24c77e vim-patch:7.4.1718
Problem:    Coverity: not using return value of set_ref_in_item().
Solution:   Use the return value.

d56374e25d
2016-12-12 10:17:35 -05:00
Michael Ennen
0645787741 vim-patch:7.4.1715
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
2016-12-12 10:17:35 -05:00
Michael Ennen
c6bc1e7bab vim-patch:7.4.1645
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
2016-12-12 10:17:35 -05:00
Michael Ennen
04f328f1ae vim-patch:7.4.1644 Mark as NA 2016-12-12 10:17:35 -05:00
Michael Ennen
9d91218213 vim-patch:7.4.1639
Problem:    Invoking garbage collection may cause a double free.
Solution:   Don't free the dict in a partial when recursive is FALSE.

5f436fcf99
2016-12-12 10:17:35 -05:00
Michael Ennen
1945013eb7 vim-patch:7.4.1638
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
2016-12-12 10:17:35 -05:00
Michael Ennen
bae31b764a vim-patch:7.4.1608
Problem:    string() doesn't handle a partial.
Solution:   Make a string from a partial.

5c29154b52
2016-12-12 10:17:35 -05:00
Michael Ennen
3213b28c01 vim-patch:7.4.1607
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
2016-12-12 10:17:35 -05:00
Michael Ennen
5241ca7d7a vim-patch:7.4.1606
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
2016-12-12 10:17:35 -05:00
Michael Ennen
34a7814219 vim-patch:7.4.1605
Problem:    Catching exception that won't be thrown.
Solution:   Remove try/catch.

3905e291fe
2016-12-12 10:17:35 -05:00
Michael Ennen
86706011a6 vim-patch:7.4.1590
Problem:    Warning for shadowed variable. (Christian Brabandt)
Solution:   Move the variable into a local block.

3f242a844e
2016-12-12 10:17:35 -05:00
Michael Ennen
531249a4ac vim-patch:7.4.1589
Problem:    Combining dict and args with partial doesn't always work.
Solution:   Use the arguments from the partial.

9e63f61cb0
2016-12-12 10:17:35 -05:00
Michael Ennen
cf2701b269 vim-patch:7.4.1586
Problem:    Nesting partials doesn't work.
Solution:   Append arguments. (Ken Takata)

8a1bb04637
2016-12-12 10:17:35 -05:00
Michael Ennen
27b2fb944a vim-patch:7.4.1585
Problem:    Partial is not recognized everywhere.
Solution:   Check for partial in trans_function_name(). (Yasuhiro Matsumoto)
            Add a test.

d22a18928e
2016-12-12 10:17:35 -05:00
Michael Ennen
e2258598ca vim-patch:7.4.1582
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
2016-12-12 10:17:35 -05:00
Michael Ennen
5cf0c99755 vim-patch:7.4.1581
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
2016-12-12 10:17:35 -05:00
Michael Ennen
2c1b4c7f3c vim-patch:7.4.1580
Problem:    Crash when using function reference. (Luchr)
Solution:   Set initial refcount. (Ken Takata)

7a5c46a9df
2016-12-12 10:17:35 -05:00
Michael Ennen
529482d684 vim-patch:7.4.1577
Problem:    Cannot pass "dict.Myfunc" around as a partial.
Solution:   Create a partial when expected.

ab1fa3955f
2016-12-12 10:17:35 -05:00
Michael Ennen
f90551b0e6 vim-patch:7.4.1564
Problem:    An empty list in function() causes an error.
Solution:   Handle an empty list like there is no list of arguments.

346418c624
2016-12-12 10:17:35 -05:00
Michael Ennen
66922d89cc vim-patch:7.4.1563
Problem:    Partial test fails on windows.
Solution:   Return 1 or -1 from compare function.

790500a8e6
2016-12-12 10:17:34 -05:00
Michael Ennen
521e45f2a8 vim-patch:7.4.1559
Problem:    Passing cookie to a callback is clumsy.
Solution:   Change function() to take arguments and return a partial.

1735bc988c
2016-12-12 10:17:34 -05:00
James McCoy
75c18b6aaa Merge pull request #5756 from jamessan/viminfo-leak
option.c: Update free_oldval after adjusting opt_idx for shada/viminfo
2016-12-12 06:55:23 -05:00
James McCoy
8995a15b20 Merge pull request #5757 from jamessan/vim-7.4.1867
vim-patch:7.4.1867
2016-12-12 06:55:11 -05:00
James McCoy
2d3c835534
vim-patch:7.4.1867
Problem:    Memory leak in test_matchstrpos.
Solution:   Free the string before overwriting. (Yegappan Lakshmanan)

3c809343c7
2016-12-11 23:21:51 -05:00
James McCoy
79c711670c
option.c: Update free_oldval after adjusting opt_idx for shada/viminfo
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
2016-12-11 23:17:50 -05:00
Justin M. Keyes
29e651515f Merge #5752 from justinmk/doc
doc: api_info(), typval_encode.h
2016-12-11 02:04:33 +01:00
Justin M. Keyes
0fe89fc9d7 Merge #5750 from justinmk/jobstart
jobstart(): Return -1 if cmd is non-executable
2016-12-11 01:38:17 +01:00
Justin M. Keyes
19848dce50 doc: README.md: update appveyor URL 2016-12-11 01:32:28 +01:00
Justin M. Keyes
100a8d40db CheckHealth: more precise check for sensible.vim
Closes #5751
2016-12-11 01:26:49 +01:00
Justin M. Keyes
cc7c42ed5d po: Remove E902 message 2016-12-11 01:14:22 +01:00