Commit Graph

7247 Commits

Author SHA1 Message Date
Justin M. Keyes
2ee60e5b28 test: nvim_ui_attach() with huge dimensions. (#5974)
Also:
- Attempt to constrain wall-of-text in screen.lua.
- Windows: Enable screen_basic_spec.lua

Closes #2180
2017-01-18 20:28:35 +01:00
Justin M. Keyes
d3b4764dc1 win: Define USE_FNAME_CASE (#5962) 2017-01-17 16:32:41 +01:00
Justin M. Keyes
be4c896845 DirChanged: set <amatch> (#5961)
Also:
- test that DirChanged is not recursive
- fix 'not trigger if :cd fails' test on Windows
2017-01-17 10:47:20 +01:00
Shougo
a062cd4ce5 vim-patch:7.4.2062 (#5954)
Problem:    Using dummy variable to compute struct member offset.
Solution:   Use offsetof().

840268400d
2017-01-16 23:18:19 +01:00
Marco Hinz
340f79b4b8 Merge #5928 'New event: DirChanged' 2017-01-16 13:36:16 +01:00
Shougo
fa94c4c2d9 vim-patch:7.4.2031 (#5955)
Problem:    The list_lbr_utf8 test fails if ~/.vim/syntax/c.vim sets
            'textwidth' to a non-zero value. (Oyvind A. Holm)
Solution:   Add a setup.vim file that sets 'runtimepath' and $HOME to a safe
            value. (partly by Christian Brabandt, closes vim/vim#912)

89b10421ca
2017-01-16 12:50:43 +01:00
Michael Schupikov
95a4244587 readfile(): Avoid file message when reading from stdin. #5956
Closes #5921
2017-01-16 01:23:48 +01:00
Justin M. Keyes
3ba5e43d2e Merge #5918 'vim-patch: 7.4.2006, 7.4.2075, 7.4.2077, 7.4.2117, 7.4.2300, 7.4.2313, 7.4.2314'. 2017-01-16 00:59:50 +01:00
Shougo
3fd7be6d3e vim-patch:7.4.2099 (#5951)
Problem:    When a keymap is active only "(lang)" is displayed. (Ilya
            Dogolazky)
Solution:   Show the keymap name. (Dmitri Vereshchagin, closes vim/vim#933)

73ac0c4281
2017-01-15 22:24:12 +01:00
Matthew Malcomson
b5560a69b1 setpos(): Set lowercase mark in other buffers (#5753)
Also make setpos("'A", [999, 1, 1, 0]) fail, i.e. return -1 (assuming there is no buffer 999).

Fixes #5713

Background:

`:help setpos()` mentions an argument `"bufnum"` that determines the buffer a mark should be put in.
This argument is respected for uppercase marks, but not for lowercase marks.
This is reasonable (though I personally would like `setpos()` to be able to set marks in other buffers), but the help doesn't mention this anywhere.

It's also strange that attempting to change buffers with `setpos('.', [bufnr('#'), 1, 1, 0])` alerts the user that having a different buffer is an error, while attempting to set a mark with `setpos("'d", [bufnr('#'), 1, 1, 0])` doesn't tell the user that the `"bufnum"` argument is an error.
2017-01-15 21:36:29 +01:00
Justin M. Keyes
a3a5090ba4 win: ci/AppVeyor: Rearrange PATH setup for python. (#5946)
This was an attempt to enable test/functional/provider/python3_spec.lua
It actually *does* appear to work if we do this:

    mingw32-make functionaltest VERBOSE=1 PATH=C:\Python35;C:\Python27;%PATH%

Note that %PATH% *already* has C:\Python35 at its start by then, so
PATH=C:\Python35;C:\Python27;%PATH% is _redundant_.
python3_spec.lua *does* find python3.exe in that case, and succeeds.
But it causes weird failures in unrelated tests:

    [----------] Running tests from C:/projects/neovim/test/functional\core\job_partial_spec.lua
    [ RUN      ] ...rojects/neovim/test/functional\core\job_partial_spec.lua @ 17: jobs with partials works correctly
    .\test\functional\helpers.lua:89: Vim(call):E903: Process for command "powershell" could not be spawned
    stack traceback:
        .\test\functional\helpers.lua:89: in function 'request'
        .\test\functional\helpers.lua:147: in function 'nvim_command'
        .\test\functional\helpers.lua:344: in function 'source'
        ...rojects/neovim/test/functional\core\job_partial_spec.lua:18: in function <...rojects/neovim/test/functional\core\job_partial_spec.lua:17>
    [  ERROR   ] ...rojects/neovim/test/functional\core\job_partial_spec.lua @ 17: jobs with partials works correctly (0.00 ms)

    [ RUN      ] C:/projects/neovim/test/functional\eval\execute_spec.lua @ 73: execute() does not capture shell-command output
    C:/projects/neovim/test/functional\eval\execute_spec.lua:74: Expected objects to be the same.
    Passed in:
    (string) '
    :!echo "foo"
    Cannot execute cmd.exe
    shell returned -1
    '
    Expected:
    (string) '
    :!echo "foo"
    '
    stack traceback:
        C:/projects/neovim/test/functional\eval\execute_spec.lua:74: in function <C:/projects/neovim/test/functional\eval\execute_spec.lua:73>
    [  FAILED  ] C:/projects/neovim/test/functional\eval\execute_spec.lua @ 73: execute() does not capture shell-command output (15.60 ms)

    [ RUN      ] C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer
    C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua:18: Expected objects to be the same.
    Passed in:
    (boolean) false
    Expected:
    (boolean) true
    stack traceback:
        C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua:18: in function <C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua:11>
    [  FAILED  ] C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer (0.00 ms)

    [ RUN      ] C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua @ 11: :edit without arguments does not restart :terminal buffer
    C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua:16: Expected objects to be the same.
    Passed in:
    (boolean) false
    Expected:
    (boolean) true
    stack traceback:
        C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua:16: in function <C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua:11>
    [  FAILED  ] C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua @ 11: :edit without arguments does not restart :terminal buffer (15.60 ms)

    [ RUN      ] ...s/neovim/test/functional\eval\msgpack_functions_spec.lua @ 457: msgpackparse() function msgpackparse(systemlist(...)) does not segfault. #3135
    .\test\functional\helpers.lua:89: Failed to evaluate expression
    stack traceback:
        .\test\functional\helpers.lua:89: in function 'eval'
        ...s/neovim/test/functional\eval\msgpack_functions_spec.lua:460: in function <...s/neovim/test/functional\eval\msgpack_functions_spec.lua:457>
    [  ERROR   ] ...s/neovim/test/functional\eval\msgpack_functions_spec.lua @ 457: msgpackparse() function msgpackparse(systemlist(...)) does not segfault. #3135 (15.63 ms)

    [  FAILED  ] 3 tests, listed below:
    [  FAILED  ] C:/projects/neovim/test/functional\eval\execute_spec.lua @ 73: execute() does not capture shell-command output
    [  FAILED  ] C:/projects/neovim/test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer
    [  FAILED  ] C:/projects/neovim/test/functional\ex_cmds\edit_spec.lua @ 11: :edit without arguments does not restart :terminal buffer
    [  ERROR   ] 2 errors, listed below:
    [  ERROR   ] ...rojects/neovim/test/functional\core\job_partial_spec.lua @ 17: jobs with partials works correctly
    [  ERROR   ] ...s/neovim/test/functional\eval\msgpack_functions_spec.lua @ 457: msgpackparse() function msgpackparse(systemlist(...)) does not segfault. #3135
     64 SKIPPED TESTS
     3 FAILED TESTS
     2 ERRORS
    -- Output to stderr:
    The system cannot find the path specified.
    CMake Error at C:/projects/neovim/cmake/RunTests.cmake:46 (message):
      Running functional tests failed with error: 1.
2017-01-15 14:45:14 +01:00
Shougo
cecaaa84cd vim-patch:7.4.2065 (#5950)
Problem:    Compiler warns for uninitialzed variable. (John Marriott)
Solution:   Set lnum to the right value.

69aa099641
2017-01-15 13:09:39 +01:00
Justin M. Keyes
192243492d test: fix syntax error
Also re-arrange the test to match Vim upstream.
2017-01-15 05:31:37 +01:00
Shougo
a6be6df5d6 vim-patch:7.4.2160 (#5952)
Problem:    setmatches() mixes up values. (Nikolai Pavlov)
Solution:   Save the string instead of reusing a shared buffer.

7dc5e2e486
2017-01-15 02:38:57 +01:00
Shougo
c88e4a270d vim-patch:7.4.1968 (#5949)
Problem:    Invalid memory access with "\<C-">.
Solution:   Do not recognize this as a special character. (Dominique Pelle)

1d90a5a5af
2017-01-15 01:08:27 +01:00
Shougo
b98da8de98 vim-patch:7.4.1910 (#5948)
Problem:    Tests using external command to delete directory.
Solution:   Use delete().

abc70bbf36
2017-01-15 00:44:16 +01:00
Shougo
1474304224 vim-patch:7.4.1851 (#5947)
Problem:    test_syn_attr failes when using the GUI. (Dominique Pelle)
Solution:   Escape the font name properly.

180fc2d418
2017-01-15 00:41:43 +01:00
James McCoy
a265ff448e Merge pull request #5940 from jamessan/master
job: Consume content from rbuffer before invoking the callback again
2017-01-14 07:49:51 -05:00
James McCoy
bde9bedb0b
job: Consume content from rbuffer before invoking the callback again
While a job callback is active, it may be invoked again.  Since the
data handled by the first invocation of the callback hasn't been marked
as consumed, the subsequent invocation will see the same data.

Reported-by: Daniel Hahler
Patch-by: oni-link
Closes #5889
2017-01-14 07:49:07 -05:00
Justin M. Keyes
58ba3bcbef Merge #5936 from blueyed/vim-8.0.0121
vim-patch:8.0.0121
2017-01-14 12:29:46 +01:00
James McCoy
947f1ebcb9 Merge pull request #5941 from blueyed/better-clint-note
src/clint.py: improve "Ignoring" message
2017-01-13 20:47:41 -05:00
Daniel Hahler
980bf1e548 Linting 2017-01-13 23:41:00 +01:00
Daniel Hahler
a0b33b333e vim-patch:8.0.0121
Problem:    Setting 'cursorline' changes the curswant column. (Daniel Hahler)
Solution:   Add the P_RWINONLY flag. (closes vim/vim#1297)

a2477fd349
2017-01-13 23:40:59 +01:00
Daniel Hahler
0aa1cff604 src/clint.py: improve "Ignoring" message
It was a bit confusing for me when seeing it myself the first time.

[ci skip]
2017-01-13 22:19:47 +01:00
Marco Hinz
1f7a119f5e
Rename yank_do_autocmd() to do_autocmd_textyankpost() 2017-01-13 15:30:02 +01:00
Marco Hinz
20867e6319
Document DirChanged 2017-01-13 15:30:01 +01:00
Marco Hinz
a05779aa1c
Move apply_autocmd_dirchanged() to vim_chdir() 2017-01-13 15:29:59 +01:00
Marco Hinz
a2f8adad4c
Add autocmd/dirchanged_spec.lua 2017-01-13 15:29:05 +01:00
Marco Hinz
197f50bf9a
Trigger DirChanged on 'autochdir' 2017-01-13 15:29:04 +01:00
Marco Hinz
30f775f8a6
Don't expand filenames during autocmd 2017-01-13 15:29:04 +01:00
Marco Hinz
bd8025727c
New event: DirChanged 2017-01-13 15:29:00 +01:00
Justin M. Keyes
f686635420 Merge #5933 from justinmk/dir-bufenter
open_buffer(): Raise `BufEnter` for directories.
2017-01-13 04:09:37 +01:00
Justin M. Keyes
82edcb593b Windows: enable more tests 2017-01-13 01:17:12 +01:00
Justin M. Keyes
cc7f1aba46 test: BufEnter 2017-01-13 01:17:11 +01:00
Justin M. Keyes
b5e8e2f20d lint 2017-01-13 01:17:11 +01:00
James McCoy
802b49ee80 Merge pull request #5935 from jamessan/dictwatcher-crash
eval: Remove dictwatcher from watchers queue before freeing it
2017-01-12 18:24:19 -05:00
Justin M. Keyes
42c922b32c open_buffer(): Do BufEnter for directories.
Abuse NOTDONE to give some nuance to the return value of readfile(), so
that open_buffer() can distinguish between "failed, lol" and "failed
because the path is a directory".

Before this change, Vim *already* creates a new buffer when a directory
is edited. So there is no reason it should not raise BufEnter, that was
an implementation detail of ye olde readfile().

Most of the changes in this commit merely preserve the old semantics.
The "implicit" change that we actually are interested in, is this line
in `open_buffer()`, where `retval` being non-FAIL allows EVENT_BUFENTER
to be applied:

    apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf, &retval);

References https://github.com/vim/vim/issues/1353
2017-01-12 23:10:38 +01:00
James McCoy
674db4b01f eval: Remove dictwatcher from watchers queue before freeing it
This fixes a use-after-free noticed by ASAN which would occur when a
dictwatcher was still active on a dictionary when the dictionary was
freed.

    fun! MakeWatch()
      let d = {'foo': 'bar'}
      call dictwatcheradd(d, 'foo', function('...'))
    endfun

Patch-by: oni-link
Closes #5930
2017-01-12 14:47:43 -05:00
James McCoy
50d0d89129 Merge pull request #5932 from jamessan/icm-fixes
inccommand: Ignore errors during preview and make cmd_can_preview stricter
2017-01-12 06:45:03 -05:00
James McCoy
f2dff86493
inccommand: Preview :sub commands only after the delimiter is present
Closes #5888
2017-01-11 21:05:02 -05:00
James McCoy
dcd77c64ef
inccommand: Suppress error reporting when previewing commands
Closes #5912
2017-01-11 21:05:02 -05:00
Justin M. Keyes
207ba359b0 Windows: vim_getenv(): Find runtime relative to nvim. #3303 (#5929)
In Windows we cannot rely on absolute install paths to point to the
location of the runtime. Vim uses the path of the current binary as
a possible location for the runtime folder. In Neovim the install
location places the runtime folder in ../share/nvim/runtime.

In Vim this logic is guarded by USE_EXE_NAME, which is defined for win32
and macOS.

TODO: We may need to incorporate similar logic for macOS:
0cdb72aa38/src/misc1.c (L4287-L4308)
2017-01-11 06:00:55 +01:00
Justin M. Keyes
a08d2f54a0 Merge #5910 from justinmk/win32-jobstart
Windows: fix jobstart()
2017-01-11 02:19:11 +01:00
Justin M. Keyes
9ecdce1d53 test: system([...]): v:shell_error 2017-01-11 01:05:56 +01:00
Rui Abreu Ferreira
1e079fa987 system([...]): Set v:shell_error=-1 if not executable.
Do _not_ set v:shell_error on parameter validation error.

system([...]) does not invoke a shell, so this change is somewhat
questionable. But `:help v:shell_error` is sufficiently vague to allow
-1 in this case.
2017-01-11 01:05:55 +01:00
Rui Abreu Ferreira
4178e865d5 Windows: ci/AppVeyor: Enable Python provider tests
Setup python2/3 and install the Neovim client in Appveyor to
enable the python tests.

- Use the Python installation provided by Appveyor, because dependencies
  pyuv, greenlet have issues compiling with MinGW-w64. And this way we
  avoid building those too.
- Copy python.exe => python3.exe so that the python provider can find
  python3.
2017-01-11 01:05:55 +01:00
Rui Abreu Ferreira
ac44d0ed54 test: system([...]) 2017-01-11 01:05:55 +01:00
Marco Hinz
15c85d8462 clipboard: only check for pbcopy on macOS (#5927)
Fixes #5926.
2017-01-11 00:50:07 +01:00
Rui Abreu Ferreira
a05ebf4a2d Windows: libuv_process_spawn(): Allow libuv argument quoting/escaping.
Closes #5360
References #3305
Reverts commit dc9652e68d.

Disabling the quoting was does not solve the problem in general, and
we would end up having to handle the quoting ourselves.

See: https://github.com/JuliaLang/julia/issues/13776
2017-01-10 23:34:04 +01:00
James McCoy
8a5962023f Merge pull request #5924 from jamessan/vim-7.4.2100
vim-patch:7.4.2100
2017-01-10 15:32:29 -05:00