Commit Graph

13525 Commits

Author SHA1 Message Date
Daniel Hahler
68c594b10c
tests: loop_spec: retry (#10413)
Flaky test (osx):

    [  FAILED  ] ...is/build/neovim/neovim/test/functional/lua/loop_spec.lua @ 23: vim.loop timer
    ...is/build/neovim/neovim/test/functional/lua/loop_spec.lua:56: Expected objects to be the same.
    Passed in:
    (number) 0
    Expected:
    (number) 2
    stack traceback:
            ...is/build/neovim/neovim/test/functional/lua/loop_spec.lua:56: in function <...is/build/neovim/neovim/test/functional/lua/loop_spec.lua:23>

It was bumped from sleeping for 20ms to 50ms in d33aaa0f5f already.
2019-07-04 16:42:10 +02:00
Daniel Hahler
0c639e8777
build: use -fdiagnostics-color=always with Ninja (#10419)
"auto" does not work, since Ninja does not appear as a TTY to gcc/clang,
but handles stripping escape codes itself when output is not to a TTY.

Ref: https://github.com/ninja-build/ninja/blob/ca041d88f4d6/src/build.cc#L158-L169
2019-07-04 15:24:33 +02:00
Daniel Hahler
05a17e419a
tests: fix flaky ':digraphs displays digraphs' (#10406) 2019-07-04 15:22:59 +02:00
Daniel Hahler
5835398152
Merge pull request #10414 from blueyed/luacheck
Improve luacheck integration, fix more issues.
2019-07-04 15:21:44 +02:00
Daniel Hahler
f668f0afb2
build: FindLuaJit: handle luajit-2.1 include path suffix (#10418) 2019-07-04 15:19:25 +02:00
Daniel Hahler
fd8d26a713
third-party: fix warning with (un)bundled libtermkey/unibilium (#10416)
Fixes warning with:

> cmake -S third-party -B .deps -DUSE_BUNDLED=OFF -DUSE_BUNDLED_UNIBILIUM=0 -DUSE_BUNDLED_LIBTERMKEY=1
> The dependency target "unibilium" of target "libtermkey" does not exist.
2019-07-04 15:17:59 +02:00
erw7
efc6d9951b win,fs.c: Fix is_executable_ext #10209
Fix issue that increment expression is executable and pointer ext
pointing out of the buffer, if the pointer ext points to the terminating
NUL.

* Change termination condition judgment to one place
* Change first condition judgment
Change to not evaluate *(ext -1) in the first condition judgment.

* Change to use copy_option_part instead of STRLCPY
2019-07-04 14:45:51 +02:00
Daniel Hahler
32361a1245 Improve luacheck setup [skip appveyor]
- Move .luacheckrc to root, add read_globals=vim
- Simplify lualint target, run it on all lua files
- Lint preload.lua, but ignore W211
- Remove testlint target, included in lualint (and lint)
- Clean up .luacheckrc
2019-07-04 12:29:54 +02:00
Sameed Ali
571b2c5e7b Fix luacheck errors for all Lua source files 2019-07-04 06:59:44 +02:00
Daniel Hahler
99b870d61c
build: bundle: clean binary dir with new downloads (#10411)
This is required to (re)build e.g. libluv when the version changes
(which triggers a new download).

With `make deps`, changing the `LUV_URL`/`LUV_SHA256`, and `make deps` again:

Before:

> Up-to-date: /home/daniel/Vcs/neovim/.deps/usr/lib/libluv.a

After:

> Installing: /home/daniel/Vcs/neovim/.deps/usr/lib/libluv.a

See with https://github.com/neovim/neovim/pull/10358 - where .deps
contained libluv 1.29, the merge updates it to 1.30, but then it failed
to link because `libluv.a` is considered to be up-to-date (after
downloading the new version).

Note that header files get installed, since they have the original time
stamp, but `libluv.a` is being generated (does not use the timestamp
from the archive here, but needs to get rebuild).

It could be argued that the build system of the included project should
catch/handle this, but it seems to be good practice to clean the binary
/ build dir with a new download to start from scratch.

Ref: https://gitlab.kitware.com/cmake/cmake/issues/19452

Also fixes cmake/BuildLuv / luv-static: use name with -DTARGET for
download command, and pass (shared) `SRC_DIR` explicitly instead.
2019-07-04 02:37:29 +02:00
Daniel Hahler
f6298aba82
tests: shell-test: add INTERACT mode (#10405)
Use it to improve ls_spec: it should not use the user's real shell for
performance and other reasons.
2019-07-03 22:49:13 +02:00
Daniel Hahler
0dc73b87f1
tests: executable_spec: keep assertion (#10408)
It was moved to become pending in 18127f64c, but the assertion should be
kept.
2019-07-03 12:56:03 +02:00
Daniel Hahler
e48257e63e
tests: fix/improve "TUI background color" tests (#10229)
- Ensure the opposite of the expected bg is active.
- Improves performance: 1.2s instead of 4.5s.
2019-07-03 03:37:19 +02:00
Daniel Hahler
d42bbf363e ci: Travis: do not close fold on failure [skip ci]
This makes it easier to inspect the test failure, without having to open
two folds (typically), and scrolling around.
2019-07-03 00:43:22 +02:00
Eisuke Kawashima
61790c7b3c build: Fix rule of build/.ran-third-party-cmake #10402
In order that `$(DEPS_BUILD_DIR)/Makefile` exists under parallel make
2019-07-03 00:25:49 +02:00
Daniel Hahler
5b94a2977a
tests: fix flaky "TermClose event triggers when fast-exiting terminal job stops" (#10377)
[  ERROR   ]...neovim/neovim/test/functional/autocmd/termclose_spec.lua @ TermClose event triggers when fast-exiting terminal job stops
    test/functional/helpers.lua:96: Vim(call):E900: Invalid channel id

    stack traceback:
            test/functional/helpers.lua:96: in function 'request'
            test/functional/helpers.lua:254: in function 'command'
            ...neovim/neovim/test/functional/autocmd/termclose_spec.lua:23: in function <...neovim/neovim/test/functional/autocmd/termclose_spec.lua:20>
2019-07-02 22:44:11 +02:00
Daniel Hahler
1c45ba462b
tests: fix flaky "terminal (with fake shell) with not arguments …" (#10401)
`retry()` would only try it three times (waiting for 20ms in between),
despite the large timeout.

Fixes https://github.com/neovim/neovim/issues/10265.
2019-07-02 19:31:36 +02:00
Björn Linse
66f7e8e8e6
Merge pull request #10397 from bfredl/cmdcleanup
cmdline: remove local variables i and j from command_line_state
2019-07-02 18:17:25 +02:00
Björn Linse
2afaf175f1 cmdline: remove local variables i and j from command_line_state 2019-07-02 10:19:39 +02:00
Justin M. Keyes
097f85ae6c
defaults: wildoptions=pum,tagfile #10384
ref #6289
2019-07-01 23:59:24 +02:00
Jan Edmund Lazo
ff95e62ff8 test/old: pass Test_recover_root_dir on Windows (#10207)
* Revert "oldtests: win: keep set dir=/"

This reverts commit 714e0f8bf0.

* test/old: set swap directory to non-existent drive

Appveyor uses Administrator user so it can write anywhere in C:\\.
Neovim creates a directory for the swap file
if the directory does not exist.
D:\\ is the backup/recovery drive so use F:\\ invoke error E303.
2019-07-01 21:51:00 +02:00
Björn Linse
5e4b93a38f
Merge pull request #10389 from bfredl/luafloat
api/lua: make nvim_execute_lua use native lua floats, not special tables
2019-07-01 20:28:00 +02:00
Jan Edmund Lazo
6c5a6ab92d vim-patch:8.1.0452: MS-Windows: not finding intl.dll #10388
Problem:    MS-Windows: not finding intl.dll.
Solution:   Also find intl.dll next to libintl.dll. (Ken Takata)
7554c548a4
2019-07-01 20:14:00 +02:00
Björn Linse
6d2b11d76c
Merge pull request #10387 from bfredl/wildpos
cmdline: correct the column position of wildoptions=pum popupmenu
2019-07-01 19:50:17 +02:00
Björn Linse
6ee05536ca api/lua: make nvim_execute_lua use native lua floats, not special tables
Rationale: the purpose of nvim_execute_lua is to simply call lua code with lua
values. If a lua function expects a floating point value, it should be enough
to specify a float as argument to nvim_execute_lua.

However, make sure to preserve the existing roundtripping behavior of
API values when using `vim.api` functions. This is covered by existing
lua/api_spec.lua tests.
2019-07-01 18:44:58 +02:00
Björn Linse
b98d1cf68b cmdline: correct the column position of wildoptions=pum popupmenu
- position might get invalid with "longest" match
- position might be wrong when completed pattern ends in "/"
2019-07-01 18:24:00 +02:00
Daniel Hahler
740fb337dd
build: fix warning with passively available libintl (#10380)
Since 0364f51 it would display a warning.
2019-07-01 03:32:52 +02:00
Daniel Hahler
6e06f4795a
build: LibLUV: update required version [ci skip] (#10381)
Required after d33aaa0f5.

Does not really make a difference, since the VERSION is not handled with
our FindLibLUV (due to missing pkg-config information
(https://github.com/luvit/luv/issues/354)).
2019-07-01 03:26:05 +02:00
Björn Linse
10a533e9d4
Merge pull request #10316 from bfredl/cb_safety
luv callbacks: throw error on deferred methods instead of crashing
2019-06-30 16:03:58 +02:00
Justin M. Keyes
3b504e7c8d
fileio.c: eliminate set_file_time() #10357
Introduce os_file_settime(), remove cruft.
2019-06-30 16:00:35 +02:00
Kovas Palunas
fdd8dcae01 man.vim: Handle ANSI escape sequences with ":" #10267
closes #10267
2019-06-30 15:25:49 +02:00
Björn Linse
99f24dfbed make vim.loop == require'luv'
This avoids initializing libluv a second time if a plugin invokes
require'luv'. It is probably not an issue, but better to be safe.
2019-06-30 15:16:32 +02:00
Björn Linse
d33aaa0f5f libluv: use luv_set_callback to control callback execution
Disable the use of deferred API functions in a fast lua callback
Correctly display error messages from a fast lua callback
2019-06-30 13:13:08 +02:00
Björn Linse
7030d7daf1 rename: FUNC_API_ASYNC => FUNC_API_FAST 2019-06-30 11:33:01 +02:00
Justin M. Keyes
0480e991d2
:digraphs : check for CTRL-C less often #10376
No need to do this so frequently.
2019-06-30 02:33:50 +02:00
Daniel Hahler
72ae0a6e5e
Makefile: CMAKE_INSTALL_PREFIX: skip parsing CMAKE_EXTRA_FLAGS if set (#10374)
Fixes:

>  Recursive variable 'CMAKE_EXTRA_FLAGS' references itself (eventually).  Stop.
2019-06-30 01:29:10 +02:00
Daniel Hahler
0364f517bb
build: update cmake/LibFindMacros.cmake (#10355)
Source: d6b5e94625/LibFindMacros.cmake
2019-06-30 01:12:38 +02:00
Daniel Hahler
75be0f0bbb Makefile: move all target to the top [ci skip] #10375
Fixes "make: Nothing to be done for 'checkprefix'." after 5031e3298.
2019-06-30 00:13:53 +02:00
Justin M. Keyes
2ef6f28e11
doc [ci skip] #10177
ref #10278 #10279 #10353
2019-06-30 00:09:45 +02:00
Daniel Hahler
52fced6090
build: update some test dependencies (#10339)
* build: update some test dependencies

* luacheck ignores

* BuildLua: add ${BUSTED} to depends for ${BUSTED_LUA}

This is required to rebuild it when busted gets updated.
2019-06-29 22:25:00 +02:00
Daniel Hahler
9875372607
build: FindLibLUV: use PkgConfig (#10359)
Apparently forgotten in c83926cd0.

- Also LIMIT_SEARCH was never used.
- Also add LIBLUV_DEFINITIONS, as used with other Find modules.
2019-06-29 21:49:49 +02:00
Daniel Hahler
5031e32986
Makefile: revisit/improve checkprefix handling (#10348)
Main improvement: do not error out, but re-run CMake in case
CMAKE_INSTALL_PREFIX changed, and only check it for "install".

- only look at CMAKE_EXTRA_FLAGS via shell if not empty
- add CMAKE_INSTALL_PREFIX to CMAKE_EXTRA_FLAGS (not CMAKE_FLAGS), to
  override it being set in CMAKE_EXTRA_FLAGS from local.mk
- use an empty "checkprefix" target if CMAKE_INSTALL_PREFIX is not
  provided
- skip checking of cached value without build/.ran-cmake; it will be run
  then anyway
- only use it with "install" target; it is only relevant there
- do not error, but re-run CMake (by removing the stamp file)
2019-06-29 21:48:40 +02:00
Justin M. Keyes
2d4a37ebab
:ls : show "R", "F" for terminal-jobs #10370
This matches Vim behavior. From `:help :ls` :

    R    a terminal buffer with a running job
    F    a terminal buffer with a finished job
    ?    a terminal buffer without a job: `:terminal NONE`

TODO: implement `:terminal NONE`.

ref #10349
2019-06-29 21:03:38 +02:00
Daniel Hahler
c207095445
build: CMake: do not set CMP0059 to old (#10363)
Keeps using add_definitions for compatibility with older CMake.

Newer CMake (3.12) would have `add_compile_definitions`, but it is not
required, since `add_defitions` was meant to be used for
compile/preprocessor definitions initially anyway.

Ref: https://github.com/neovim/neovim/pull/4389
2019-06-29 20:37:48 +02:00
Daniel Hahler
39ba35b38d cmake/RunTests.cmake: fix TEST_TAG/TEST_FILTER [ci skip] #10371
Followup to f1f9a2f97.
The mentioned example there did not work after all, likely due to
changing quoting during PR review.
2019-06-29 19:15:48 +02:00
Daniel Hahler
e9f1bdabb8
tests: fix flaky "timers can be stopped from the handler" (#10364)
Seen on Travis (osx):

    [ RUN      ] timers can be stopped from the handler: FAIL
    .../build/neovim/neovim/test/functional/eval/timer_spec.lua:167: Expected objects to be the same.
    Passed in:
    (number) 2
    Expected:
    (number) 3
    stack traceback:
            .../build/neovim/neovim/test/functional/eval/timer_spec.lua:167: in function <.../build/neovim/neovim/test/functional/eval/timer_spec.lua:153>
2019-06-29 17:53:09 +02:00
Justin M. Keyes
e2ce5ff9d6
viml/profile: switch to uv_gettimeofday() #10356
Performance of high-resolution time (clock_gettime via uv_hrtime) is
expensive on some systems.  For profiling VimL, syntax, etc., we don't
care about nanosecond-precision and monotonicity edge-cases, so avoid
uv_hrtime().

closes #10328

From the uv__hrtime() source:
0cdb4a5b4b/src/unix/linux-core.c (L442-L462)

    /* Prefer CLOCK_MONOTONIC_COARSE if available but only when it has
     * millisecond granularity or better.  CLOCK_MONOTONIC_COARSE is
     * serviced entirely from the vDSO, whereas CLOCK_MONOTONIC may
     * decide to make a costly system call.
     */

This micro-benchmark (Debug build) shows negligible differences on my
system:

    #include <sys/time.h>
    ...

    proftime_T tm = profile_start();
    int trials = 999999;
    int64_t t = 0;
    struct timeval tv;
    for (int i = 0; i < trials; i++) {
      t += gettimeofday(&tv,NULL);
    }
    tm = profile_end(tm);
    ILOG("%d trials of gettimeofday: %s", trials, profile_msg(tm));
    tm = profile_start();
    for (int i = 0; i < trials; i++) {
      t += os_hrtime();
    }
    tm = profile_end(tm);
    ILOG("%d trials of os_hrtime: %s", trials, profile_msg(tm));
    tm = profile_start();
    for (int i = 0; i < trials; i++) {
      t += os_utime();
    }
    tm = profile_end(tm);
    ILOG("%d trials of os_utime: %s", trials, profile_msg(tm));
    ILOG("%zu", t);
2019-06-29 16:39:22 +02:00
Justin M. Keyes
23a9794920
Merge #10369 from janlazo/vim-8.0.1202
vim-patch:8.0.{1202,1259}
2019-06-29 13:51:50 +02:00
Jan Edmund Lazo
489d3b084f vim-patch:8.0.1259: search test can be flaky
Problem:    Search test can be flaky.
Solution:   Use WaitFor() instead of a delay.  Make it possible to pass a
            funcref to WaitFor() to avoid the need for global variables.
            (James McCoy, closes vim/vim#2282)
13deab8d08
2019-06-28 23:53:28 -04:00
Jan Edmund Lazo
bddc4dc0ed vim-patch:8.0.1238: incremental search only shows one match
Problem:    Incremental search only shows one match.
Solution:   When 'incsearch' and and 'hlsearch' are both set highlight all
            matches. (haya14busa, closes vim/vim#2198)
2e51d9a097
2019-06-28 23:47:16 -04:00