Commit Graph

3711 Commits

Author SHA1 Message Date
Marco Hinz
9d876eb037 Test: synIDattr(): true color awareness 2015-07-18 16:55:25 +02:00
Marco Hinz
84ce97714b synIDattr(): true color awareness
In Vim, which doesn't true colors, synIDattr('Foo', 'fg') returns either
ctermfg or guifg depending on whether vim or gvim is running.

True colors naturally use GUI colors, so synIDattr() has to be adapted to
return guifg, if a TUI with enabled true colors is used.
2015-07-18 16:55:25 +02:00
Wander Nauta
7732bec9b8 eval: Fix duplicate code in trig/math functions #3035
The same error checking/recovery code was duplicated among the f_acos,
f_asin, f_atan, f_ceil, f_cos, f_cosh, f_exp, f_floor, f_log, f_log10,
f_round, f_sin, f_sinh, f_sqrt, f_tan, f_tanh and f_trunc functions.
This commit moves that code into a wrapper function.

`trunc` is not in C90, but it is in C99, which is what neovim targets,
so we use it here.
2015-07-18 10:33:22 -04:00
Justin M. Keyes
14ae3c0cbd Merge #2609 'Macro cleanup' 2015-07-17 22:13:20 -04:00
Hettomei
3b06ce200b Macro cleanup: FEAT_SHORTCUT, replace with WIN32 2015-07-17 21:40:40 -04:00
Hettomei
b69f1b85f5 Macro cleanup: FEAT_BEVAL_TIP 2015-07-17 21:40:40 -04:00
Hettomei
28d39db171 Macro cleanup: FEAT_GUI_MSWIN 2015-07-17 21:40:39 -04:00
Hettomei
9b58fc6986 Macro cleanup: FEAT_GUI_MAC 2015-07-17 21:40:39 -04:00
Hettomei
db9bcadb05 Macro cleanup: FEAT_GUI_X11 2015-07-17 21:40:39 -04:00
Hettomei
bd819aaed0 Macro cleanup: FEAT_GUI_GTK 2015-07-17 21:40:39 -04:00
Hettomei
5360324974 Macro cleanup: FEAT_TOOLBAR 2015-07-17 21:40:38 -04:00
Hettomei
343040f318 Macro cleanup: FEAT_BEVAL 2015-07-17 21:40:38 -04:00
Hettomei
848a5e2e87 Macro cleanup: USE_FILE_CHOOSER 2015-07-17 21:40:38 -04:00
Hettomei
6d937315b6 Macro cleanup: FEAT_GUI_MOTIF 2015-07-17 21:40:38 -04:00
Hettomei
031758ad5c Macro cleanup: FEAT_GUI_W32 2015-07-17 21:40:37 -04:00
Hettomei
1b7dcb2f70 Macro cleanup: FEAT_GUI and ALWAYS_USE_GUI 2015-07-17 21:40:37 -04:00
Michael Reed
4d79edccdc Cleanup after #3007 #3020
'guioptions' is mentioned in the "Option Defaults" section of vim_diff,
and while its default did indeed change, it was only because the 't'
flag was removed.  To make that clear, move its reference to the
"Removed Features" section instead.

Remove stray instance of 't' flag from GO_ALL.  Most if not all of the
GO_* #defines are unused, but lets keep them for now as it's not clear
whether they won't be used by Nvim GUIs.
2015-07-17 17:36:38 -04:00
Felipe Morales
5e9f9a8756 spell: Defer &spell prompt until VimEnter. #3027
Closes #1551
2015-07-17 06:59:25 -04:00
Thiago de Arruda
883b78d298 Merge PR #2980 'Refactor event loop layer'
Helped-by: oni-link <knil.ino@gmail.com>
Reviewed-by: oni-link <knil.ino@gmail.com>
Reviewed-by: Scott Prager <splinterofchaos@gmail.com>
2015-07-17 00:46:34 -03:00
Thiago de Arruda
aa9cb48bf0 job: Replace by a better process abstraction layer
- New libuv/pty process abstraction with simplified API and no globals.
- Remove nvim/os/job*. Jobs are now a concept that apply only to programs
  spawned by vimscript job* functions.
- Refactor shell.c/channel.c to use the new module, which brings a number of
  advantages:
  - Simplified API, less code
  - No slots in the user job table are used
  - Not possible to acidentally receive data from vimscript
- Implement job table in eval.c, which is now a hash table with unilimited job
  slots and unique job ids.
2015-07-17 00:32:07 -03:00
Thiago de Arruda
9d8d2b7fa8 server: Extract most logic into the new socket abstraction
- Move event loop code into event/socket
- Reimplement server.c on top of the new SocketWatcher class
- Adapt msgpack_rpc/channel.c
2015-07-17 00:19:55 -03:00
Thiago de Arruda
ac2bd02561 rstream/wstream: Unify structures and simplify API
- Simplify RStream/WStream API and make it more consistent with libuv.
- Move into the event loop layer(event subdirectory)
- Remove uv_helpers module.
- Simplify job/process internal modules/API.
- Unify RStream and WStream into a single structure. This is necessary because
  libuv streams can be readable and writable at the same time(and because the
  uv_helpers.c hack to associate multiple streams with libuv handle was removed)
- Make struct definition public, allowing more flexible/simple memory
  management by users of the module.
- Adapt channel/job modules to cope with the changes.
2015-07-17 00:19:55 -03:00
Thiago de Arruda
991d3ec1e6 event loop: New abstraction layer with refactored time/signal API
- Add event loop abstraction module under src/nvim/event. The
  src/nvim/event/loop module replaces src/nvim/os/event
- Remove direct dependency on libuv signal/timer API and use the new abstraction
  instead.
- Replace all references to uv_default_loop() by &loop.uv, a new global variable
  that wraps libuv main event loop but allows the event loop functions to be
  reused in other contexts.
2015-07-17 00:19:19 -03:00
Thiago de Arruda
9e42ef4e13 test: lower sleep value in job test
Since sleep is a grandchild of nvim, it is not killed after the test ends.
Using a low sleep value allows it to exit automatically after a small interval.
2015-07-16 23:10:01 -03:00
Thiago de Arruda
e85c9966b8 test: Increase determinism in screen_basic_spec tests 2015-07-16 23:08:09 -03:00
Lucas Hoffmann
d88c93acf3 tests: Style improvements and Makefile fix for migrated test 60. #2975 2015-07-16 20:31:20 -04:00
Marco Hinz
1e03165074 Remove :tearoff #3007
This also removes the 't' flag from 'guioptions'.

Side effect: :term[inal] -> :te[rminal]

Closes #3003.
2015-07-15 22:03:35 -04:00
Felipe Morales
59784b91db vim-patch:7.4.688 #2941
```
updated for version 7.4.668
Problem:    Can't use a glob pattern as a regexp pattern.
Solution:   Add glob2regpat(). (Christian Brabandt)
```

https://code.google.com/p/vim/source/detail?r=v7-4-668
2015-07-14 14:25:54 -04:00
oni-link
9a72f6b955 terminal.c: Fix memory leak #2982
dict_set_value() returns the replaced Object in a dictionary. Here
the Object is unused and needs to be freed.
2015-07-14 00:37:48 -04:00
Fredrik Fornwall
e0b550b5f0 Remove dead WIFSTOPPED and WIFCONTINUED checks
These macros would never return true since the preceding waitpid() call
did not specify the WUNTRACED or WCONTINUED options (which is correct
since we only care for processes that exited here).

Besides removing dead code, this improves portability since WIFCONTINUED
is not defined on all platforms.
2015-07-13 23:12:31 -03:00
cztchoice
c80ebfff82 vim-patch:7.4.736 #2998
Problem:    Invalid memory access.
Solution:   Avoid going over the end of a NUL terminated string. (Dominique
            Pelle)

https://github.com/vim/vim/commit/v7-4-736
2015-07-11 22:38:17 -04:00
Justin M. Keyes
366aa8c196 Merge #2846 'out-of-bounds slicing' 2015-07-11 22:33:57 -04:00
Justin M. Keyes
7b56a8230f test: buffer_spec: fix set_line invocation
- pcall result was always false because of wrong arity
- also re-arrange tests into it() blocks
2015-07-11 22:33:05 -04:00
Nick Hynes
c2f14bb89c test: api: exercise out-of-bounds line slicing 2015-07-11 18:20:35 -04:00
Nick Hynes
7475c1c0f7 api: return error when starting a slice out of bounds. 2015-07-11 18:18:25 -04:00
Nick Hynes
90b4276d67 api: return empty array when slicing out of bounds. 2015-07-11 18:17:36 -04:00
Michael Reed
5fdaac45a6 Merge pull request #2718 from lucc/test62
[RDY] tests: Migrate legacy test 62.

Reviewed-by: Scott Prager <splinterofchaos@gmail.com>
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Reviewed-by: Michael Reed <m.reed@mykolab.com>
2015-07-10 20:57:24 -04:00
Lucas Hoffmann
c51d0e49a9 tests: Modernize migrated legacy test 62.
- use eval() and eq() in many places instead of writing to the buffer
- remove has('autocmd') checks and use corresponding code unconditionally as
  neovim always has the autocmd feature
- split the test into several it() blocks

Helped-By: Scott Prager <splinterofchaos@gmail.com>
Helped-By: Michael Reed <m.reed@mykolab.com>
2015-07-11 00:55:16 +02:00
Lucas Hoffmann
98c022c329 tests: Migrate legacy test 62. 2015-07-11 00:47:49 +02:00
Björn Linse
73d9cd85df rplugin: Don't error if plugin is registered before host #2961
This makes it possible to register a lazy loaded host in a plugin/ file.
Previously this caused an error on restart after :UpdateRemotePlugins
2015-07-10 22:11:13 +02:00
Thiago de Arruda
ba2f7a9310 Merge PR #2938 'Travis: Refactor CI files, use container infrastructure' 2015-07-08 07:42:23 -03:00
Florian Walch
be39fc9151 Travis: Check some configuration variables in before_script. 2015-07-08 07:42:16 -03:00
Florian Walch
78ec75fb60 Travis: Use gcov that matches the used compiler.
This fixes gcov/coveralls warnings like the following:

    Segmentation fault (core dumped)
    charset.c.gcno:version '501*', prefer '406*'
    Out of memory allocating 33061786568 bytes after a total of 2522648 bytes

http://stackoverflow.com/a/14676272/249642
2015-07-08 07:42:16 -03:00
Florian Walch
d2eb4a9346 Travis: Refactor CI files, use container infrastructure.
* Split build steps to utilize the Travis build lifecycle.
 * Move shell code from `.travis.yml` into Bash files in `.ci/`,
   one file for each step of the Travis build lifecycle.
 * Use configuration variables in `.travis.yml` to change
   build behavior (e.g. build 32-bit with `BUILD_32BIT=ON`).
 * Keep all configuration in environment variables in
   `.travis.yml`. In scripts, concatenate environment variables
   according to configuration to change to different behavior.
 * Add GCC 5 builds for Linux.
 * Use Travis's caching feature [1] for third-party dependencies
   and pip packages.
 * Allow failures MSan, as the errors it reports have to be
   fixed first.

Valgrind is still disabled, but can be enabled by setting
`env: VALGRIND=ON` for a job in `.travis.yml`.

[1] http://docs.travis-ci.com/user/caching
2015-07-08 07:42:16 -03:00
Florian Walch
bac2700e2f CMake: Allow overriding third-party install prefix. 2015-07-08 07:42:16 -03:00
oni-link
b165145084 rbuffer: Fix for problems with escape input sequences.
If at least two escape sequences were read, the beginning of the
second sequence would be off by one and the sequence would be
misinterpreted.

An escape sequence could be split in two parts and be
misinterpreted, when saved in a ring buffer with wrap around.

Fixes #2936
2015-07-07 16:58:10 +02:00
Justin M. Keyes
3955ffa305 os/*defs: restore some comments and formatting. 2015-07-06 08:23:21 -04:00
Yamakaky
d4b4d7d0ec refactor: remove SYS_MENU_FILE (unused) 2015-07-06 08:23:21 -04:00
Yamakaky
2e46765849 Split os_unix_defs.h into os/ 2015-07-06 08:23:21 -04:00
Florian Walch
e949c2bd62 vim-patch:7.4.646 #2926
Problem:    ":bufdo" may start at a deleted buffer.
Solution:   Find the first not deleted buffer. (Shane Harper)

https://github.com/vim/vim/commit/v7-4-646
2015-07-06 15:09:32 +03:00