Commit Graph

6255 Commits

Author SHA1 Message Date
ZyX
e07da3a71b kvec,typval_encode: Add new vector: the one with preallocated array 2016-06-24 16:53:26 +03:00
ZyX
90b8cf133e msgpack_rpc: Also make msgpack_from_*/msgpack_to_* functions not recur
This removes some stack overflows in new test regarding deeply nested variables.
Now in place of crashing vim_to_object/msgpack_rpc_from_object/etc it crashes
clear_tv with stack overflow.
2016-06-24 16:53:26 +03:00
ZyX
6b06bdafa2 unittests: Add tests for vim_to_object function 2016-06-24 16:53:26 +03:00
ZyX
da15b5c1f3 api/helpers: Use typval_encode.h for vim_to_object
This ought to prevent stack overflow, but I do not see this actually working:
*lua* code crashes with stack overflow when trying to deserialize msgpack from
Neovim, Neovim is fine even if nesting level is increased 100x (though test
becomes very slow); not sure how recursive function may survive this. So it
looks like there are currently only two positive effects:

1. NULL lists are returned as empty (#4596).
2. Functional tests are slightly more fast. Very slightly. Checked for Release
   build for test/functional/eval tests because benchmarking of debug mode is
   not very useful.
2016-06-24 16:53:26 +03:00
Justin M. Keyes
47a15d0256 Merge #4865 from ZyX-I/file-buffered-read
Use buffered reading/writing for ShaDa files
2016-06-24 09:18:26 -04:00
J Phani Mahesh
1a91000251 ex_cmds2.c:style: Silence all clint warnings 2016-06-24 17:50:50 +05:30
ZyX
4741c8b234 unittests: Fix testlint errors 2016-06-24 09:29:51 +03:00
ZyX
96a57e1bc6 os/fileio: Use readv often 2016-06-24 01:07:09 +03:00
ZyX
6580dfeddd unittests: Fix kFileNoSymlink test on FreeBSD
Actual value on FreeBSD is -31, UV_EMLINK was obtained from
/usr/include/asm-generic/errno-base.h (there EMLINK is defined as 31 there).
This may actually be something else, but I do not think so as “Too many links”
description also fits in. [Man page][1] agrees with me, search for `[EMLINK]`
([linux man page][2] also specifies ELOOP explicitly in a similar section).

[1]: https://www.freebsd.org/cgi/man.cgi?query=open&sektion=2
[2]: http://man7.org/linux/man-pages/man3/open.3p.html
2016-06-24 00:07:57 +03:00
ZyX
75bd39d49c *: Satisfy linter (newest type casts rule) 2016-06-24 00:07:56 +03:00
ZyX
a3b05a03b6 unittests: Fix bug somewhere that makes file_read tests SEGV 2016-06-24 00:07:56 +03:00
ZyX
2dd154457c file: Move src/nvim/file.* to src/nvim/os/fileio.* 2016-06-24 00:07:55 +03:00
ZyX
fec7983ecd unittests: Add tests for file.c
Also fixes some errors found.
2016-06-24 00:07:54 +03:00
ZyX
3e7c8e7149 unittests: Add os_write test
New os/fs.c functions are now all tested.
2016-06-23 21:17:51 +03:00
ZyX
4b9d2caec2 shada: Do not forget to close ShaDa reader
Previously there was file descriptor leak, not detected by sanitizers. Now it is 
file descriptor leak with a small memory leak which is detected by ASAN what 
fails one of the tests (actually, “ShaDa support code leaves .tmp.z in-place 
when there is error in original ShaDa and it has .tmp.a … .tmp.x”, but error is 
reported at the next test because leaks are not detected until Neovim exit and 
Neovim exit happens when clear()/reset() is called which happens in before_each 
only).
2016-06-23 21:17:51 +03:00
ZyX
a8f3849bc0 file: Use own constants, do not rely on fcntl.h
One of the reasons is that O_RDONLY is zero, which makes checking whether file
is opened read- or write-only harder. It is not guaranteed that on other system
O_WRONLY will not be zero (e.g. because file can only be opened in read-write
mode).
2016-06-23 21:17:51 +03:00
ZyX
2ac5f1138b unittests: Add os_close, os_read and os_readv tests 2016-06-23 21:17:51 +03:00
ZyX
516b7071ca file: Add buffered reading and writing
Still no busted tests. Not tested without HAVE_PREADV.
2016-06-23 21:17:51 +03:00
ZyX
11dda658d6 file,os/fs,shada: Separate opening, closing, writing and reading files
Moves low-level functions handling to os/fs.c. Adds file.c with a proxy
interface.

Target: while leaving syscalls handling is os.c (partially handled by libuv),
add buffering for reading and writing to file.c.
2016-06-23 21:17:51 +03:00
Björn Linse
65af001f2b Merge pull request #4952 from bfredl/counttest
test: fix command_count_spec
2016-06-23 19:02:40 +02:00
Björn Linse
e8a8342132 test: fix command_count_spec
The test hit wait_return if x or .x.swp exists in the project root directory.
2016-06-23 16:54:19 +02:00
Nicolai Skogheim
c475e3f8d1 cmake: remove unused includes (#4947) 2016-06-22 22:46:21 -04:00
James McCoy
dff0dd2611 Merge pull request #4949 from jamessan/vim-7.4.1592
vim-patch:7.4.1592
2016-06-22 22:04:00 -04:00
James McCoy
438c5d27b0 lint 2016-06-22 21:21:05 -04:00
James McCoy
cde1d818d0 vim-patch:7.4.1592
Problem:    Quickfix code using memory after being freed. (Dominique Pelle)
Solution:   Detect that the window was closed. (Hirohito Higashi)

0899d69803
2016-06-22 21:10:07 -04:00
Justin M. Keyes
a2ecbc2cc0 Merge #4929 from mhinz/fix-term
Fix #3864
Fix #4820
2016-06-21 12:27:58 -04:00
Marco Hinz
1a8d9e9d54 Add tests for new feature 2016-06-20 23:10:46 +02:00
Marco Hinz
a05e7a6bca Make existing tests work with new feature 2016-06-20 23:10:41 +02:00
Marco Hinz
cc8f477d18 Always resize the embedded vterm properly 2016-06-20 18:20:45 +02:00
Justin M. Keyes
7df9dd33a1 Merge #4933 from ZyX-I/fix-matchparen-spec
Make matchparen_spec.lua fail if matchparen is not available
2016-06-20 01:30:59 -04:00
Justin M. Keyes
8a4e5b4bc2 Merge #4697 'capture() function'. 2016-06-20 00:55:41 -04:00
Justin M. Keyes
d5ddebe9e2 Merge #4938 from justinmk/coverity
coverity/149459: CHECKED_RETURN (false positive)
2016-06-18 15:56:04 -04:00
Justin M. Keyes
8c28baa7c7 doc: api_info 2016-06-18 15:01:51 -04:00
Justin M. Keyes
cf89160d6e coverity/149459: CHECKED_RETURN (false positive) 2016-06-18 15:01:50 -04:00
Justin M. Keyes
1e93e24f5e Merge #4851 2016-06-18 13:09:01 -04:00
Justin M. Keyes
abeb2f020f test/highlight_spec: Test "gui" arg of synIDattr().
Also use less "regular" values for cterm colors.
2016-06-18 13:07:59 -04:00
Rom Grk
86b138b25d synIDattr(): return RRGGBB value for [fg|bg|sp]# #4851
add tests for synIDattr() with [fg|bg|sp]#

add tests for synIDattr and various #RGB colors

synIDattr: test for ui_rgb_attached()

test: fix tests for synIDattr fg/bg/sp
2016-06-18 12:25:11 -04:00
Justin M. Keyes
cbda7d85f8 build: Revert 464bc16.
This was more trouble than it is worth:

- remove_directory fails if doc/ is not owned by the user
- some devs build in-tree, then deleting doc/ breaks the build
- `make install` isn't affected by the stale files at all: the tags are
  built before install-time

So, reverting this change means only that devs who use a build/
directory will need to delete build/runtime/doc/ on the occasion that we
rename a doc file.
2016-06-18 12:22:42 -04:00
Björn Linse
a59330d6fc Merge pull request #4925 from bfredl/apiinfo
eval: add api_info()
2016-06-17 21:49:56 +02:00
ZyX
2126ec0c5b functests: Fix matchparen_spec.lua 2016-06-17 20:38:03 +03:00
Björn Linse
16424caeda eval: add api_info()
Previously, the api metadata was only accessible frow within nvim as
msgpackparse(systemlist('nvim --api-info'))[0]
2016-06-17 18:47:45 +02:00
Justin M. Keyes
51fe40a033 Merge #4923 from justinmk/doc
doc: cleanup
2016-06-16 01:48:05 -04:00
Justin M. Keyes
1b1be69cd6 Merge pull request #4841 from jamessan/vim-7.4.1126
vim-patch:7.4.1126
2016-06-16 01:27:17 -04:00
Justin M. Keyes
464bc16f81 build: Purge docs before rebuilding.
If a help file is renamed, stale help files in the build workspace will
cause duplicate tags (which causes the build to fail). To avoid this,
always delete build/runtime/doc/ before building helptags.
2016-06-16 00:31:54 -04:00
Justin M. Keyes
742787fe9e doc: consolidate nvim.txt 2016-06-15 22:50:38 -04:00
Justin M. Keyes
2dbf040048 doc: uppercase RPC 2016-06-15 22:50:37 -04:00
Justin M. Keyes
37f560aedf doc/python: cleanup
- Move info to providers.txt
- Remove "nvim-" prefix.
- Brevity, clarity, ...
2016-06-15 22:50:37 -04:00
Justin M. Keyes
7718f8f24c doc/provider: cleanup
- Move design/impl discussion to develop.txt
- Move clipboard notes to provider.txt
2016-06-15 19:31:11 -04:00
Justin M. Keyes
c698ed0531 doc: cleanup 2016-06-15 19:31:11 -04:00
Justin M. Keyes
30a7d551ee doc/terminal: cleanup 2016-06-15 19:31:11 -04:00