Commit Graph

3186 Commits

Author SHA1 Message Date
Thiago de Arruda
6f471fa4fc event: Ensure the loop is stopped when a event is pushed. 2015-03-25 18:57:35 -03:00
Thiago de Arruda
b16c5bf5e6 buffer: Move b_p_ma(modifiable) checks into the MODIFIABLE macro 2015-03-25 18:57:35 -03:00
Thiago de Arruda
8b6b06c2e0 buffer: Add WITH_BUFFER macro to simplify global buffer modification
Most internal functions to modify buffers operate on the current buffer and
require temporary switchs. This macro is a temporary workaround until a cleaner
refactoring of the internal API is performed.
2015-03-25 18:57:35 -03:00
Thiago de Arruda
2b90aed831 vim.h: remove #ifndef EINTR
This ifndef causes problems when including fileio headers.
2015-03-25 18:57:35 -03:00
Thiago de Arruda
071aca9c8a api: Move switch_to_win_for_buf/restore_win_for_buf to api helpers 2015-03-25 18:57:35 -03:00
Thiago de Arruda
05d60c4812 ui: Schedule screen refreshs to run in the event loop
This is required to avoid event loop recursion due to indirect calls to
os_breakcheck by screenalloc
2015-03-25 18:57:35 -03:00
Thiago de Arruda
51c69b89a7 map: Add Map(int, int) 2015-03-25 18:57:34 -03:00
Thiago de Arruda
05c030c725 map: Add map_clear method 2015-03-25 18:57:34 -03:00
Thiago de Arruda
5cf3dec9a9 syntax: Fix possible invalid read in hl_combine_attr 2015-03-25 18:57:34 -03:00
David Bürgin
d2d99454e6 tests: Migrate legacy test 94 #2218 2015-03-25 16:33:24 -04:00
Justin M. Keyes
c56c035576 Merge #2236 'docs cleanup' 2015-03-24 19:53:31 -04:00
Michael Reed
d85fabc24f doc: Remove refs to 'compatible' and friends
Also remove some MS-DOS references on lines already being touched.

Based on this commit:
e4db01ca87
2015-03-24 19:33:42 -04:00
Justin M. Keyes
adfc8cf50a doc: Misc. cleanup
Add missing parentheses and whatnot, move dangling comment, etc. Some
specific items worth mentioning:

Fixed some references to non-existent tags, found via `make html`

msgpack_rpc/channel.c:
  ELOG already prefixes each line with "error @ ..."
2015-03-24 19:29:29 -04:00
Justin M. Keyes
ab68ac4c02 doc: Add one-liner job control example 2015-03-24 19:29:29 -04:00
Michael Reed
c60dd09408 doc: Cleanup for #2099
Said PR changed the behavior of `undercurl` in the TUI, but didn't
document it.
2015-03-24 19:29:29 -04:00
Michael Reed
bb7aa04e61 Remove --nofork / -f remnants 2015-03-24 19:29:29 -04:00
Justin M. Keyes
e16ff72e71 Merge #2148 'misc1.c: split some environment functions' 2015-03-24 16:29:18 -04:00
bobtwinkles
3fc18e25b8 refactor: add tests for env_expand_esc 2015-03-24 16:13:00 -04:00
bobtwinkles
03d47965c0 refactor: split some more functions from misc1.c
This commit pulls the some environment-variable handling functions out of
misc1.c and in to os/env.c. Previously submited as #1231, this is the start of
a patch series that does that work based on a more up-to-date master branch.

Major tasks accomplished:
  - move functions and fix includes
  - fix clint/clang analysis warnings
  - correct documentation comments
2015-03-24 16:13:00 -04:00
Thiago de Arruda
ed1070bb24 Merge PR #2146 'Improve functional test debuggability and efficiency' 2015-03-24 12:59:59 -03:00
Thiago de Arruda
1ee7ca7bc0 test: Improve functional test debuggability and efficiency
- Read TEST_TAG/TEST_FILTER env vars from cmake/RunTests.cmake. Setting these
  environment variables will pass --tags/--filter to busted, which can used to
  filter which tests are executed.
- Remove calls to nvim msgpack-rpc API outside tests. This removes the
  requirement of having a static `clear` call in test/functional/helpers.lua
- Use the new busted command-line option "--lazy" to ensure the setup/teardown
  hooks are only executed when a suite runs at least one test.

Now its possible to run/debug a single test like this:

```sh
TEST_FILTER='some test string' make test
```

Which will only run tests containing "some test string" in the title.
Another option is:

```sh
TEST_TAG=some-tag make test
```

After putting #some-tag into the test title. This also improves debugging
experience because there will be no unnecessary gdbserver instances whe GDB=1 is
passed.
2015-03-24 12:46:15 -03:00
Thiago de Arruda
47e90ea1c5 test: Extract code to spawn nvim into the "spawn" helper function
This is can be used for spawning nvim outside a test context. Also refactor
screen.lua to use this function when loading the color map(It is better because
the GDB/VALGRIND environment variables are ignored)
2015-03-24 12:46:15 -03:00
Thiago de Arruda
5874bc28ea deps: Update busted and dependencies 2015-03-24 12:46:15 -03:00
Thiago de Arruda
5860d65f9c Merge PR #2237 'Job fixes to core and tests' 2015-03-24 12:04:46 -03:00
Thiago de Arruda
d6369707c2 test: Fix tty-test program
The "tty ready" string must only be printed when the process is ready to receive
signals, and this only happens when the event loop has started.
2015-03-24 10:56:53 -03:00
oni-link
56ef37eb59 job: Fix memory error
Fix pointer passed to the handles in the uv_close() calls when process_spawn()
fails.
2015-03-24 10:56:53 -03:00
Thiago de Arruda
a6fb511c7f job: Fix process cleanup using SIGCHLD/waitpid
Add a SIGCHLD handler for cleaning up pty processes passing the WNOHANG flag. It
may also be used to cleanup processes spawned with uv_spawn.
2015-03-24 10:56:42 -03:00
John Szakmeister
0c6fdd5251 Merge pull request #2213 from jszakmeister/add-junit-support
build: add support for running the tests in junit format
2015-03-24 06:00:44 -04:00
Justin M. Keyes
424c04f2c9 Merge pull request #2214 from Pyrohh/version-cleanup
Version output cleanup
2015-03-23 08:20:22 -04:00
Michael Reed
8c19152dcb version.c: Clean up --version / :version output
Despite the +/- prefix, the majority of these features have been made
non-optional at compile time, so their presence here is misleading.

Also mention `:h vim-differences` to make it clear our that many
features are non-optional.
2015-03-22 16:55:50 -04:00
Björn Linse
1257b303ac Merge pull request #2212 from bfredl/concealfix
fix missing  conceal cchar when it is the first syntax group shown
2015-03-22 21:17:35 +01:00
Michael Reed
eea804ab59 Remove *_BUILTIN_TCAPS & 'ttybuiltin'
'ttybuiltin' was removed and *_BUILTIN_TCAPS was made into dead code in
PR #1820.
2015-03-22 15:41:29 -04:00
Eliseo Martínez
4bc62c76c7 Merge #2184: Fix coverity issues. (6)
Reviewed-by: oni-link <knil.ino@gmail.com>
2015-03-22 11:45:48 +01:00
Eliseo Martínez
44b563409e Passing-by: Add function attributes. 2015-03-22 11:32:30 +01:00
Eliseo Martínez
c6784d9f6f coverity/105985: Resource leak: RI.
Problem    : Resource leak @ 94, 98, 102.
Diagnostic : Real issue.
Rationale  : Coverity doesn't know that uv_pipe_open will save file
             descriptor to close them later. So, it signals file
             descriptors being leaked. This would then seem like a false
             positive we can fix by teaching coverity about uv_pipe_open
             through model file.
             But then we realize that the above is only true if
             uv_pipe_open succeeds. It it fails, then descriptors are
             really being leaked, which is why this is considered a real
             issue and not a false positive after all.
Resolution : Add error handling to correctly close descriptors if
             uv_pipe_open fails at any point.
             Add model for uv_pipe_open so that Coverity knows it will
             save descriptors when no error.

Helped-by: oni-link <knil.ino@gmail.com>
2015-03-22 11:32:30 +01:00
Eliseo Martínez
a2b4535747 coverity/105982: Unckecked return value: RI.
Problem    : Unchecked return value from library @ 91.
Diagnostic : Real issue.
Rationale  : fcntl can fail, which is not being checked.
Resolution : Add corresponding error handling.

Helped-by: oni-link <knil.ino@gmail.com>
2015-03-22 11:32:20 +01:00
Eliseo Martínez
3db0a40d69 coverity/105568: Free of array-typed value: FP.
Problem    : Free of array-typed value @ 3628.
Diagnostic : False positive.
Rationale  : expand_shell_cmd() is called with a mock value for file
             (*file = (char_u **)""). That means we want file to be
             filled with a new value. We can't use *file = NULL because
             that means we don't want file to be filled.
             Now, coverity incorrectly thinks that sentinel value is the
             one we are freeing up at some other later point, which is
             not the case.
Resolution : Assert that, when we are freeing *file, its value is
             different than the sentinel one.
2015-03-22 11:31:47 +01:00
Eliseo Martínez
fb44a233a5 coverity/13777: String not null terminated: RI.
Problem    : String not null terminated @ 1543.
Diagnostic : Real issue.
Rationale  : We are reading a struct block0, which contains some string
             fields, from a file, without checking for string fields to
             be correctly terminated. That could cause a buffer overrun
             if file has somehow been garbled.
Resolution : Add string fields check for nul termination.
             Mark issue as intentional (there seems to be no way of
             teaching coverity about read_eintr being ok that way).

Helped-by: oni-link <knil.ino@gmail.com>
2015-03-22 11:31:46 +01:00
Björn Linse
04c8235df0 vim-patch: mark 7.4.673 as included 2015-03-21 22:05:50 +01:00
John Szakmeister
afae3e25d5 build: add support for running the tests in junit format
This requires a couple of extra modules that are not installed by
default, and it requires capturing stdout of the tests--otherwise CMake
output is intermixed with the XML output of busted.
2015-03-21 09:47:49 -04:00
Björn Linse
19ca54b969 syntax: let first syntax item seqnr be 1 instead of 0
in screen.c:win_line seqnr 0 represents the state: no current syntax
item
2015-03-21 13:48:29 +01:00
Michael Reed
4fc0291c73 Update to libuv 1.4.2 2015-03-21 09:21:51 -03:00
Gustaf Lindstedt
a9e6a768c5 legacy test script: minor string handling fix #2181
Add check to see if a string contains ], which can result in
cases where wrapping a string in [[...]] breaks. Use [=[...]=] instead
on those strings.

Use [=[...]=] for insert() and expect().
2015-03-20 18:19:19 -04:00
Perry Hung
26e6bca769 vim-patch:7.4.503 #2178
Problem:    Cannot append a list of lines to a file.
Solution:   Add the append option to writefile(). (Yasuhiro Matsumoto)

https://code.google.com/p/vim/source/detail?r=v7-4-503

-Ported old legacy test over to
    test/functional/legacy/writefile_spec.lua
-Tests for mapping and signs from the original patch were removed since
    they have nothing to do this with feature

Tested with: make oldtest, make test on OS X.

Signed-off-by: Perry Hung <iperry@gmail.com>
2015-03-20 17:54:28 -04:00
Nikolai Aleksandrovich Pavlov
2d0f7fa95d README: Do not call translator transpiler
Never liked this term and never saw it in any dictionaries.
2015-03-20 21:56:15 +03:00
Thiago de Arruda
8dd415e887 tui: Add support for true color terminals
This is enabled by setting the `$NVIM_TUI_ENABLE_TRUE_COLOR` environment
variable, eg:

```
$ NVIM_TUI_ENABLE_TRUE_COLOR=1 nvim
```
2015-03-20 13:20:21 -03:00
Florian Walch
29b6fc57e8 deps: Use released versions for unibilium, msgpack-c. 2015-03-20 13:18:53 -03:00
John Szakmeister
90bce5ad38 Merge pull request #2144 from jszakmeister/fix-warning-in-release
Fix a couple warnings in the release build.
2015-03-20 09:54:06 -04:00
Perry Hung
657d274520 Remove BINARY_FILE_IO option #2179
The 'binary' mode flag is ignored on all POSIX conforming systems (man 3
fopen). For all the others, BINARY_FILE_IO needs to be set.

Always set BINARY_FILE_IO.

Signed-off-by: Perry Hung <iperry@gmail.com>
2015-03-18 04:42:39 -04:00
Michael Reed
8f6ecc4089 misc2.c: Move emsg* functions to message.c #2152
Clean up said functions and some outdated comments while we're at it.
2015-03-19 18:33:39 -04:00