Commit Graph

3245 Commits

Author SHA1 Message Date
Scott Prager
9353fcf024 server: add unit tests 2015-04-14 15:31:04 -04:00
Scott Prager
296719428a eval: learn serverstart, list, and close().
Implement functions for spawning, destroying, and listing active
servers, and add server_address_list() to msgpack_rpc/server.c for the
serverlist() vimL function.
2015-04-14 15:31:04 -04:00
Scott Prager
4a66c48d8b msgpack_rpc/server.c: Use a garray over a kmap.
Testing of server_start() and server_stop() found that after adding a
server at address addr, pmap_has(addr) would always return true, but
pmap_get(addr) would always return NULL.

Since a client is only expected to have a small number of servers, an
array may be more efficient than a hash map, anyway.

Discussion:
https://github.com/neovim/neovim/pull/1302#issuecomment-88487148
2015-04-14 15:20:50 -04:00
Rui Abreu Ferreira
71487a935e Implement os_unsetenv()
- In UNIX systems where unsetenv() is available, it is used. Otherwise
  the variables are set with the empty string.
- New check HAVE_UNSETENV for unsetenv()
- Added unit test to env_spec.lua
2015-04-14 15:20:50 -04:00
Thiago de Arruda
a9ee85b9fc Merge PR #2415 'Use jemalloc instead of libc allocator' 2015-04-13 09:30:57 -03:00
Thiago de Arruda
2d104f14db clint: Add rules to check for memory functions calls 2015-04-13 08:23:08 -03:00
Thiago de Arruda
8a1a9b9558 deps: Add jemalloc as an optional dependency
Jemalloc will be used if the cmake option `USE_JEMALLOC` is enabled(which is the
default). To avoid trouble with clang's ASAN, it is disabled by default if the
`SANITIZE` option is enabled.

Since jemalloc has thread cache for small objects, it fills the gap created by
removing klib memory pools.

The `xstrdup` funciton(memory.c) had to be reimplemented on top of `xmalloc` to
make it work with a custom allocator.
2015-04-13 08:22:59 -03:00
Thiago de Arruda
34c48aaf12 memory: Add free wrapper and refactor project to use it
We already use wrappers for allocation, the new `xfree` function is the
equivalent for deallocation and provides a way to fully replace the malloc
implementation used by Neovim.
2015-04-13 08:22:44 -03:00
Thiago de Arruda
ba10e311bd memory: Replace klib memory pools by malloc/free
Klib pools were used to improve allocation efficiency for some small objects,
but it is not a thread-safe approach. Thread safety in allocations will be
required for implementing #2371).
2015-04-12 17:20:24 -03:00
Thiago de Arruda
27b5ef3975 eval: Fix memory deallocation of JobEvent
This causes a "read after free" error when kmp_free is replaced by `free`.
2015-04-12 17:20:24 -03:00
Mark Bainter
0248c75bc1 remove char_u: vim_version_dir #2414
See: #459
2015-04-12 16:14:45 -04:00
Mark Bainter
917ba54ff5 refactor remove_tail() function to no longer use char_u #2413
See #459
2015-04-12 16:13:22 -04:00
David Bürgin
e129e2792d tests: Fix test setup/teardown in path_spec.lua #2402
A call to lfs.mkdir instead of lfs.rmdir left a temp directory hanging
around. Changed to do proper setup/teardown using {before,after}_each.

Helped-by: Scott Prager <splinterofchaos@gmail.com>
Suggested-by: Scott Prager <splinterofchaos@gmail.com>
2015-04-12 16:11:50 -04:00
Marco Hinz
fb6e931268 Remove obsolete CENT macro #2397
The CENT macro was set condionally depending on the FEAT_GUI constant that was
removed a long time ago.

Other small refactorings:

  - remove obsolete TERM= flags
  - sort and indent lines in array for readability
  - 'Conceal' and 'WildMenu' were moved from highlight_init_{dark,light}[]
    to highlight_init_both[] since the same values were used anyway
2015-04-12 11:00:11 -04:00
Mark Bainter
675e363316 Refactor default_vim{,runtime}_dir to use char type. #2375
See: #459
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com>
2015-04-12 10:52:51 +02:00
Justin M. Keyes
ecc28fb2dd Merge pull request #2117 from justinmk/fix1836
memline: fix segfaults
2015-04-12 02:48:34 -04:00
Justin M. Keyes
1e767ad96f fix: segfault in ml_recover() if swap file not found
- To reproduce: ":recover non_existent_swapfile"
- Regression: 00f18e2e09
2015-04-12 01:17:45 -04:00
Justin M. Keyes
813690bb68 fix: segfault in recover_names(): must not concat full path
- regression by 42f1bd9b22
- closes #1836
2015-04-12 01:14:54 -04:00
Justin M. Keyes
b23e444b37 test regression: recover_spec.lua 2015-04-12 01:14:54 -04:00
Justin M. Keyes
04806dee4b test: helpers.lua: add temporary set_session() function
This function is needed until helpers.lua is refactored to support
multiple sessions.
2015-04-12 01:02:58 -04:00
Justin M. Keyes
2275297f4a test: migrate legacy test 78 2015-04-12 01:02:58 -04:00
Justin M. Keyes
86ee88163e passing-by: mark non-null return; remove invalid OOM check.
remove some #ifdef noise
2015-04-12 01:02:58 -04:00
Marco Hinz
e4975f82c9 Expand :profile's filename #2390
vim_strsave() is replaced by expand_env_save_opt(), which expands ~ for
convenience:

    :profile start ~/.nvim/prof.log

Prior to this change you had to specify an absolute path.
2015-04-11 19:22:49 -04:00
Michael Reed
5b390395e6 Merge pull request #2404 from Pyrohh/coverity-108870
[RFC] coverity/108870: Missing break in switch
2015-04-11 18:05:06 -04:00
Eliseo Martínez
4a2c737e68 Merge #2410: Fix coverity issues. (7)
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
2015-04-11 23:06:41 +02:00
Eliseo Martínez
95d6f4416e coverity/{13738,13739,68853,13717,13720,13716,68854,13718,13721}: FP.
All these issues are false positives that result from coverity's
inability to properly follow arithmetic implications in expressions
using some macros. Redefining macros another way to make arithmetic
implications clearer fixes the issues.
2015-04-11 22:34:57 +02:00
Michael Reed
9a363ca7a3 Merge pull request #2398 from mhinz/docs-remove-jobactivity
[RFC] Remove all references to JobActivity
2015-04-11 15:12:38 -04:00
Marco Hinz
0e65962a68 Remove all references to JobActivity
The JobActivity event got replaced by callback functions provided to
jobstart() or termopen().

It got removed here:

6e7757ad51
2015-04-11 18:32:18 +02:00
Thiago de Arruda
8171fc4cbc Merge PR #2405 'Job control fixes' 2015-04-11 09:10:54 -03:00
Thiago de Arruda
484fd734ab build: Remove busted output handler utfTerminalDetailed
Busted now contains "gtest", which can be used for the same purpose as
utfTerminalDetailed.
2015-04-11 08:46:59 -03:00
Thiago de Arruda
ad8d415e3a test: Remove indeterminism in job_spec.lua pty tests 2015-04-11 08:46:59 -03:00
Thiago de Arruda
ccd42e81c8 eval: Fix jobwait()
- Properly save job event deferring state for recursive calls
- Disable breakcheck while running. Breakcheck can invoke job callbacks
  in unexpected places.
2015-04-11 08:46:59 -03:00
Thiago de Arruda
17db7f1e14 eval: Fix segfault caused by passing invalid callback to jobstart 2015-04-11 08:46:59 -03:00
Björn Linse
5bd85fd954 Merge pull request #2381 from bfredl/unnamed
fix update v:register and the " register when clipboard=unnamed
2015-04-11 12:57:38 +02:00
Björn Linse
a6487ae9cb ops.c: cleanup of get_yank_register 2015-04-11 11:14:22 +02:00
Björn Linse
9978a01faa clipboard: fix "" register not updated when clipboard=unnamed
Helped-By: Scott Prager <splinterofchaos@gmail.com>
2015-04-11 11:11:52 +02:00
Björn Linse
941b02af4c clipboard: adjust v:register when clipboard=unnamed
Helped-By: Nicolas Hillegeer <nicolas@hillegeer.com>
Helped-By: Michael Reed <m.reed@mykolab.com>
2015-04-11 11:11:52 +02:00
Michael Reed
98f976b861 coverity/108870: Missing break in switch 2015-04-10 22:12:29 -04:00
Michael Reed
e584fe0057 doc: Remove |shell-window|
fixes #2384
2015-04-10 16:38:11 -04:00
Michael Reed
95b7059d45 Remove unused 'if_[language].txt': Review 2015-04-10 16:38:11 -04:00
Michael Reed
5bc151c2a4 Remove unused 'if_[language].txt': Clean up
Regarding |script-here|: despite being a language agnostic piece of
advice, it was in `if_perl.txt`. Regardless, we now only have one
support for one legacy plugin interface, so put it in `if_pyth.txt`
2015-04-10 16:38:11 -04:00
Michael Reed
b0cc6eadd7 doc: Remove unused 'if_[language].txt' and related
Rubycomplete requires 'if_ruby', which has never been in Neovim. Because
of this, remove some mentions of it from the docs, but keep the actual
plugin untouched (as to avoid unneeded maintainence costs). It has a
call to `has('ruby')`, so it will still fall back to syntax completion.
2015-04-10 16:38:11 -04:00
Michael Reed
ea8325024e Bring E319 (cmd not available) in line with E519 (opt not available) 2015-04-10 16:38:11 -04:00
Michael Reed
baba9f7096 Clarify that nvim has no built-in GUI 2015-04-10 16:38:10 -04:00
Alexey Shmalko
6139c72251 coverity/{108271,108272,108273}: add fallthrough annotation #2362
Signed-off-by: Michael Reed <m.reed@mykolab.com>
2015-04-10 02:05:48 -04:00
Michael Reed
5f743a120b README.md: Link to neovim.org/Community #2167
[ci skip]
2015-04-09 17:39:49 -04:00
David Bürgin
cb7bb70c49 scripts: Fix "test input line" logic in legacy2luatest.pl #2369
Fixes the handling of the initial input lines of a test script by simply
skipping all initial empty lines.

Helped-by: Florian Walch <florian@fwalch.com>
Suggested-by: Florian Walch <florian@fwalch.com>
2015-04-09 11:40:09 -04:00
David Bürgin
42af7daa25 mark.c: Remove JUMPLIST_ROTATE #2376
JUMPLIST_ROTATE is never defined, and the feature is not popular.
2015-04-09 11:21:51 -04:00
Scott Prager
4a7364c807 Merge pull request #2374 from mhinz/hl-group-termcursor
[RDY] Add new highlight groups TermCursor and TermCursorNC
2015-04-09 11:14:22 -04:00
Marco Hinz
cd7b910e81 Add new highlight groups TermCursor/TermCursorNC
These highlight groups replace the old mechanism of setting:

  - {g,b}:terminal_focused_cursor_highlight
  - {g,b}:terminal_unfocused_cursor_highlight
2015-04-09 16:38:32 +02:00