Commit Graph

7599 Commits

Author SHA1 Message Date
Michael Ennen
bae8a19c63 vim-patch:7.4.2235
Problem:    submatch() does not check for a valid argument.
Solution:   Give an error if the argument is out of range. (Dominique Pelle)

989f592f7f
2017-02-14 17:38:19 -07:00
Michael Ennen
effe760b13 vim-patch:7.4.2233
Problem:    Crash when using funcref() with invalid name. (Dominique Pelle)
Solution:   Check for NULL translated name.

843b884461
2017-02-14 17:38:19 -07:00
Michael Ennen
8cae66b5e0 vim-patch:7.4.2197
Problem:    All functions are freed on exit, which may hide leaks.
Solution:   Only free named functions, not reference counted ones.

c257487035
2017-02-14 17:38:18 -07:00
Michael Ennen
e2f76d190d vim-patch:7.4.2143
Problem:    A funccal is garbage collected while it can still be used.
Solution:   Set copyID in all referenced functions.  Do not list lambda
            functions with ":function".

bc7ce675b2
2017-02-14 17:38:18 -07:00
Michael Ennen
00ac82eae2 vim-patch:7.4.2142
Problem:    Leaking memory when redefining a function.
Solution:   Don't increment the function reference count when it's found by
            name. Don't remove the wrong function from the hashtab.  More
            reference counting fixes.

8dd3a43d75
2017-02-14 17:38:18 -07:00
Michael Ennen
42727ecf08 vim-patch:7.4.2141
Problem:    Coverity reports bogus NULL check.
Solution:   When checking for a variable in the funccal scope don't pass the
            varname.

ba96e9af38
2017-02-14 17:38:18 -07:00
Michael Ennen
e71e9020eb vim-patch:7.4.2139
Problem:    :delfunction causes illegal memory access.
Solution:   Correct logic when deciding to free a function.

0588d4f9d2
2017-02-14 17:38:18 -07:00
Michael Ennen
53fad45115 vim-patch:7.4.2137
Problem:    Using function() with a name will find another function when it is
            redefined.
Solution:   Add funcref().  Refer to lambda using a partial.  Fix several
            reference counting issues.

437bafe4c8
2017-02-14 17:38:18 -07:00
Michael Ennen
1f715ac1c1 vim-patch:7.4.2136
Problem:    Closure function fails.
Solution:   Don't reset uf_scoped when it points to another funccal.

5801644819
2017-02-14 17:38:18 -07:00
Michael Ennen
1e3c0efa0f vim-patch:7.4.2134
Problem:    No error for using function() badly.
Solution:   Check for passing wrong function name. (Ken Takata)

b54c3ff317
2017-02-14 17:38:17 -07:00
Michael Ennen
d7c798cd86 vim-patch:7.4.2121
Problem:    No easy way to check if lambda and closure are supported.
Solution:   Add the +lambda feature.

9532fe7fbe
2017-02-14 17:38:17 -07:00
Michael Ennen
f59321e319 vim-patch:7.4.2120
Problem:    User defined functions can't be a closure.
Solution:   Add the "closure" argument. Allow using :unlet on a bound
            variable. (Yasuhiro Matsumoto, Ken Takata)

10ce39a0d5
2017-02-14 17:38:17 -07:00
Michael Ennen
9f6f7fe26d vim-patch:7.4.2119
Problem:    Closures are not supported.
Solution:   Capture variables in lambdas from the outer scope. (Yasuhiro
            Matsumoto, Ken Takata)

1e96d9bf98
2017-02-14 17:38:17 -07:00
Michael Ennen
6563d85990 vim-patch:7.4.2104
Problem:    Code duplication when unreferencing a function.
Solution:   De-duplicate.

97baee80f0
2017-02-14 17:38:17 -07:00
Michael Ennen
cbaa87a639 vim-patch:7.4.2096
Problem:    Lambda functions show up with completion.
Solution:   Don't show lambda functions. (Ken Takata)

b49edc11a1
2017-02-14 17:38:17 -07:00
Michael Ennen
7f4848aff4 vim-patch:7.4.2090
Problem:    Using submatch() in a lambda passed to substitute() is verbose.
Solution:   Use a static list and pass it as an optional argument to the
            function.  Fix memory leak.

df48fb456f
2017-02-14 17:38:17 -07:00
Michael Ennen
a0ce663710 vim-patch:7.4.2076
Problem:    Syntax error when dict has '>' key.
Solution:   Check for endchar. (Ken Takata)

4f0383bc3f
2017-02-14 17:38:16 -07:00
Michael Ennen
fc46efd3f2 vim-patch:7.4.2072
Problem:    substitute() does not support a Funcref argument.
Solution:   Support a Funcref like it supports  a string starting with "\=".

72ab729c3d
2017-02-14 17:38:16 -07:00
Michael Ennen
bb7d0deb2f vim-patch:7.4.2044
Problem:    filter() and map() either require a string or defining a function.
Solution:   Support lambda, a short way to define a function that evaluates an
            expression. (Yasuhiro Matsumoto, Ken Takata)

069c1e7fa9
2017-02-14 17:38:16 -07:00
Michael Ennen
6c423989fc vim-patch:7.4.2002
Problem:    Crash when passing number to filter() or map().
Solution:   Convert to a string. (Ozaki Kiichi)

a06ec8f345
2017-02-14 17:38:16 -07:00
Michael Ennen
bb2afeb026 vim-patch:7.4.1989
Problem:    filter() and map() only accept a string argument.
Solution:   Implement using a Funcref argument (Yasuhiro Matsumoto, Ken
            Takata)

b33c7eb5b8
2017-02-14 17:38:16 -07:00
Michael Ennen
b0fc6108c9 vim-patch:7.4.1727
Problem:    Cannot detect a crash in tests when caused by garbagecollect().
Solution:   Add garbagecollect_for_testing().  Do not free a job if is still
            useful.

ebf7dfa6f1
2017-02-14 17:38:15 -07:00
Nikolai Aleksandrovich Pavlov
64c375c589 unittest: Filter out standard defines so that they do not spam stderr (#6113) 2017-02-15 01:21:06 +01:00
ZyX
095e6cc2e0 *: Fix linter errors 2017-02-15 03:15:47 +03:00
ZyX
efa2682e3b *: Partial string handling refactoring
Main points:

- Replace `char_u` with `char` in some cases.
- Remove `str[len] = NUL` hack in some cases when `str` may be considered
  `const`.
2017-02-15 02:48:33 +03:00
ZyX
ee16f78fa9 strings: Fix “unexpected format specifier: %lp” ASAN error 2017-02-15 00:45:04 +03:00
ZyX
0086991b1b eval: Fix linter error 2017-02-15 00:28:34 +03:00
Justin M. Keyes
2a50ff7e2f Merge #6108 from ZyX-I/pr-5678
Better core dumps checking
2017-02-14 21:43:01 +01:00
ZyX
f489827b5f eval: Fix error messages from writefile
1. When calling writefile(list, fname, []) do not show error message twice.
2. Do not allow file name to be overwritten for writefile([1], 2).
3. Do not show “Can’t open file with an empty name” error after error like 
   “using Float as a String” when type of the second argument is not correct.
4. Do not give multiple error messages and still continue for code like 
   `writefile(["test", [], [], [], "tset"])`.

Note that to fix 4. ideally I need tv_check_str_or_nr which is currently present 
in two PRs: #6114 and #5119. I would want to avoid copying this function into 
a yet another PR.

Ref vim/vim#1476.
2017-02-14 20:46:12 +03:00
ZyX
066e6b8e9b eval: Return immediately after an error in write_list()
Previously it could attempt to write trailing newline before returning.
2017-02-14 19:40:16 +03:00
James McCoy
eaf9caaf43 Merge pull request #6118 from lonerover/vim-patch
scripts/vim-patch.sh: don't ignore runtime/doc/tagsrch.txt
2017-02-14 06:02:21 -05:00
lonerover
891d412d6c vim-patch.sh: don't ignore runtime/doc/tagsrch.txt 2017-02-14 16:14:41 +08:00
Nikolai Aleksandrovich Pavlov
6e881872f4 api/helpers: Remove NULL dereference (#6109)
Even though all used compilers can swallow this code, it is still
undefined behaviour.
2017-02-14 00:09:49 +01:00
Justin M. Keyes
2f38ed11c9 providers: Disable if g:loaded_* exists.
The exists('g:loaded_foo') convention is rather common, and may be
relied upon in some cases. It's also very unlikely that a user or plugin
has any reason to set g:loaded_foo to zero, so the principle of least
surprise can be brushed aside here.

https://github.com/neovim/neovim/issues/6107#issuecomment-279532143
2017-02-14 00:02:50 +01:00
ZyX
2e179214b8 eval: Remove outdated comment 2017-02-14 01:39:43 +03:00
ZyX
fe0eecf9cc eval: writefile: Give more adequate IO errors and do not call putc() 2017-02-14 01:10:31 +03:00
ZyX
222d98310a os/fileio: Support appending to a file 2017-02-14 01:10:05 +03:00
ZyX
85e1a56560 os/fileio: Allow certain failures during file_fsync
According to the documentation fsync() may fail with EROFS or EINVAL if “file 
descriptor is bound to a special file which does not support synchronization” 
(e.g. /dev/stderr). This condition is completely valid in this case since main 
point of `file_fsync()` is dumping buffered input.
2017-02-14 01:09:59 +03:00
ZyX
a429235b6d message,strings: Move vim_*printf functions to strings.c
Allows eval/typval.h to #include message.h.
2017-02-14 00:53:03 +03:00
ZyX
943531cf9e ci: Make sure core* is the last component of path 2017-02-14 00:33:52 +03:00
Justin M. Keyes
59f12e7d61 ui_detach: Do not redraw during teardown/exit. 2017-02-14 00:33:52 +03:00
ZyX
d670591887 ci: Better core dump checking
- Do not exclude any directories from `find` search, remove dumps before tests
  instead.
- Install `apport` on travis so that linux tests should produce core dumps
  (based on information from travis-ci/travis-ci#3754, not sure whether it still
  applies).
- Check cores in lua so that one has an idea which test is failing exactly. Do
  this only 10% of time on linux because traversing the file system is slow.

Unit tests are still not touched, though it is what `app` argument in
`check_cores` is for.

TODO? consider using `find`, it may be faster. Consider retiring `os.execute`,
      dealing with escaping is bad.
2017-02-14 00:33:52 +03:00
ZyX
3e94510570 ci: Try checking for core dumps
Note: can’t use `dbg_cmd` string because I need arguments with spaces (i.e. `bt
all` and `thread apply all bt full`).
2017-02-14 00:33:20 +03:00
ZyX
da2139296d ci: Extract prepare_build() from build_nvim() 2017-02-14 00:32:52 +03:00
Justin M. Keyes
9451647d9b health.vim: Do not check intentionally disabled providers.
Closes #6107
2017-02-13 22:21:23 +01:00
Justin M. Keyes
4a511de881 ci: Do not use oldtest target on Travis. (#6101)
We must invoke src/nvim/testdir/Makefile directly.
Explained in 3d1084f264:
> Running tests from the top-level Makefile will use the third-party
> dependencies from .deps instead of the ones from the Travis cache.

If we could run `oldtest` with CMake, we would not need to do this. Need
USES_TERMINAL feature (CMake 3.2+) for that.
2017-02-13 15:07:49 +01:00
Justin M. Keyes
b5965bbd24 Merge #6106 from justinmk/health.vim
health.vim: Reduce visual noise.
2017-02-13 02:33:50 +01:00
Justin M. Keyes
770d60d904 coverity/13728: Null pointer dereference (#6100)
coverity claims that `valid_tabpage(NULL)` can return true...
2017-02-12 21:09:52 +01:00
Justin M. Keyes
2ddadaa28c Merge #6084 from justinmk/fix-coverity-155968
coverity/155968: resource leak
2017-02-12 21:09:16 +01:00
Justin M. Keyes
f50de5be41 health.vim: ruby provider advice 2017-02-12 12:51:54 +01:00