Commit Graph

13858 Commits

Author SHA1 Message Date
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
Jan Edmund Lazo
805d6e450a vim-patch:8.0.1202: :wall gives an errof for a terminal window
Problem:    :wall gives an errof for a terminal window. (Marius Gedminas)
Solution:   Don't try writing a buffer that can't be written. (Yasuhiro
            Matsumoto, closes vim/vim#2190)
059db5c29f
2019-06-28 22:22:59 -04:00
Daniel Hahler
c696fcdcaa build: remove patch: luv-Add-missing-definitions-for-MinGW [skip travis] #10360
Added in 4ae7acd15 initially, but seems to not be necessary anymore,
and/or should be send upstream otherwise.
2019-06-28 13:19:47 +02:00
Daniel Hahler
6765bbc651
build: CMake: remove usage of USE_BUNDLED_X in main project (#10354)
The variables are not meant to be defined there really, but only with
the third-party project.

Using them, e.g. with the following, would actually result in libvterm
not being found then:

    make CMAKE_EXTRA_FLAGS="-DUSE_BUNDLED_LIBVTERM=ON" \
      DEPS_CMAKE_FLAGS="-DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBVTERM=ON"

In https://github.com/neovim/neovim/pull/6357 they were renamed to
`USE_BUNDLED_X` from `X_USE_BUNDLED`, but the above reasoning applies
to the old names, too.

Internally `CMAKE_PREFIX_PATH` is used to add the built/bundled third
party packages for `find_package`, so there is no reason to e.g. query
the values via `load_cache` for example from the third-party project.
2019-06-28 02:02:19 +02:00
Justin M. Keyes
9f64e4b73f
Merge #10349 from janlazo/vim-8.0.0935
vim-patch:8.0.{935,1013,1100,1119}
2019-06-27 22:31:51 +02:00
Daniel Hahler
35b959c600
CMakeLists: remove/cleanup passing of CMAKE_SYSTEM_NAME (#10351)
Just set it from `${CMAKE_HOST_SYSTEM_NAME}` directly, instead of passing it
from the main CMake file (CMAKE_SYSTEM_NAME defaults to it, but is empty
in script mode).

Initially added in 9ce81f7b2, but then even used with unrelated commands
(that do not use RunTests.cmake, e.g. 221f6fffa).
2019-06-27 20:14:00 +02:00
Daniel Hahler
31dbc6f63e
build: BuildLua: fix check for mingw [skip ci] (#10352) 2019-06-27 20:11:45 +02:00
Daniel Hahler
04f559dc05
ci: AppVeyor: GCOV_ERROR_FILE: head/tail [skip ci] (#10335) 2019-06-27 14:38:33 +02:00
Jan Edmund Lazo
d555e44219 vim-patch:8.0.1120: :tm means :tmap instead of :tmenu
Problem:    :tm means :tmap instead of :tmenu. (Taro Muraoka)
Solution:   Move the new entry below the old entry. (closes vim/vim#2102)
63c4e8a198
2019-06-27 07:59:49 -04:00
Jan Edmund Lazo
2b400daca3 vim-patch:8.0.1100: stuck in redraw loop when 'lazyredraw' is set
Problem:    Stuck in redraw loop when 'lazyredraw' is set.
Solution:   Don't loop on update_screen() when not redrawing. (Yasuhiro
            Matsumoto, closes vim/vim#2082)
072412ed45
2019-06-26 21:49:29 -04:00
Jan Edmund Lazo
58cf81914d vim-patch:8.0.1013: terminal window behaves different from a buffer with changes
Problem:    A terminal window with a running job behaves different from a
            window containing a changed buffer.
Solution:   Do not set 'bufhidden' to "hide".  Fix that a buffer where a
            terminal used to run is listed as "[Scratch]".
e561a7e2fa
2019-06-26 20:51:18 -04:00
Jan Edmund Lazo
59b35d6a10 vim-patch:8.0.0935: cannot recognize a terminal buffer in :ls output
Problem:    Cannot recognize a terminal buffer in :ls output.
Solution:   Use R for a running job and F for a finished job.
304b64c9e6
2019-06-26 20:39:24 -04:00
Daniel Hahler
a924650d98
Makefile: fix regression with "make functionaltest-lua" (#10346)
Regressed in 69eb4fa0c.
2019-06-26 22:44:48 +02:00
Daniel Hahler
c62690ccc4
ci: Travis: upgrade OSX images (10.1 => 10.2) (#10319)
* ci: Travis: upgrade OSX images (10.1 => 10.2)

* ci: nvim-deps: use `cp -a`  [skip appveyor]

Symlinks should be preserved.

Ref: https://github.com/neovim/neovim/pull/10319#issuecomment-505410132
2019-06-26 20:06:40 +02:00
Björn Linse
ac013d7147
Merge pull request #10342 from bfredl/apisandbox
eval/api: don't allow the API to be called in the sandbox
2019-06-26 11:59:08 +02:00
Justin M. Keyes
469726d3c5
Merge #10340 from janlazo/vim-8.1.1593
vim-patch:8.0.1688,8.1.1593
2019-06-26 11:01:10 +02:00
Björn Linse
8b263c7a68
Merge pull request #10344 from bfredl/extcmdredraw
cmdline: remove invalid cmdline_show event when aborting mapping
2019-06-26 10:47:18 +02:00
Björn Linse
48b4ecc96d
Merge pull request #10343 from bfredl/scrollblend
compositor: handle scrolling of blended window
2019-06-26 10:07:54 +02:00