Commit Graph

7478 Commits

Author SHA1 Message Date
Justin M. Keyes
497db001df test: expand_env_esc()
Test expand_env_esc() using the same parameters reported in #3725.

Closes #3725
2017-01-21 18:17:44 +01:00
Justin M. Keyes
bd16e116eb win: test: Enable jobstart() 'shell' test. (#5983) 2017-01-21 17:04:39 +01:00
Justin M. Keyes
10864cd939 Merge #5977 from justinmk/tui-cursor-shape
tui: enable NVIM_TUI_ENABLE_CURSOR_SHAPE by default
2017-01-21 12:21:56 +01:00
Rui Abreu Ferreira
a27fcf38fd Windows: Install runtime dependencies with Neovim binary
Look for runtime dependencies diff.exe and win32yank.exe (and
recursively for DLL dependencies) and install them with nvim.exe. If a
dependency is missing a warning will be issued.
2017-01-20 18:29:18 +00:00
Rui Abreu Ferreira
1cb52309f1 Enable clipboard provider tests in Windows 2017-01-20 18:29:18 +00:00
Rui Abreu Ferreira
f59bb4be6c third-party: Add helper to fetch binary dependencies
Add cmake script with recipes to download binary dependencies, currently
the only dependency is win32yank.
2017-01-20 18:29:17 +00:00
Rui Abreu Ferreira
33cd06dfb7 Windows: Clipboard provider win32yank 2017-01-20 18:29:17 +00:00
Justin M. Keyes
ef753a76b9 tui: Enable mode-sensitive cursor by default.
Also give NVIM_TUI_ENABLE_CURSOR_SHAPE more granularity:
0 = do not change cursor shape
1 = non-blinking ("steady") cursor with mode-sensitive shape
2 = blinking cursor with mode-sensitive shape

Note: blink state is not changed for Konsole, instead user's terminal
preference makes the decision. (Can't do that for xterm-likes, DECSCUSR
forces us to choose blink-state.)

This is a temporary step until the TUI respects 'guicursor'
Ref: https://github.com/neovim/neovim/issues/2583#issuecomment-272988384
2017-01-20 15:48:41 +01:00
Justin M. Keyes
030349d852 input_enqueue(): Fix length calculation. (#5981)
Ref: https://github.com/neovim/neovim/issues/5885#issuecomment-273614373
2017-01-20 13:49:38 +01:00
Justin M. Keyes
4b2759b6da vim-patch:7.4.2049,7.4.2050,7.4.2064,7.4.2067,7.4.2081 (#5969)
vim-patch:7.4.2049,7.4.2050,7.4.2064,7.4.2067,7.4.2081
2017-01-20 13:11:26 +01:00
Justin M. Keyes
8684fdda3b tui: Do not decide cursor blinking.
"CSI ? 12 l" stops cursor blinking. `unibi_cursor_normal` need only
_show_ the cursor, not make any pronouncement about cursor blinking.
User's terminal setting (or NVIM_TUI_ENABLE_CURSOR_SHAPE) takes
precedence.
2017-01-20 01:59:29 +01:00
Justin M. Keyes
e7de3b5f84 test/timer_spec.lua: Relax expected count.
Test sometimes fails on AppVeyor (Windows). 300/50=6, but there could be
environment factors that miss the timer interval on the "edges".
timer_start() does not have such a hard requirement.
2017-01-19 14:46:29 +01:00
Justin M. Keyes
3a574af3c4 ci: Disable "CTRL-C interrupts :global" test
This test is low-value, high-cost. It's slow, and sometimes crashes
luajit. It's still enabled on local runs, that's good enough.
2017-01-19 14:22:01 +01:00
Justin M. Keyes
b7b82f8c71 Merge #5937 from justinmk/win32-test
Windows: test: enable job_spec.lua
2017-01-19 11:10:58 +01:00
Justin M. Keyes
5db30dcc19 Merge #5865 from lonerover/vim-7.4.2036
vim-patch:7.4.2036
2017-01-19 10:56:19 +01:00
Justin M. Keyes
7637df4b59 win: test: XXX: Disable some tests. 2017-01-19 09:55:57 +01:00
Justin M. Keyes
32c7971b2a win: fix warnings 2017-01-19 09:55:57 +01:00
Justin M. Keyes
e40946a5be win: test: enable job_spec.lua
- Default to powershell.
- Avoid hardcoded "-c".
- Remove ^M character from received lines.
- pending_win32(): clear() is unnecessary and it pollutes the tests.

Closes #3973
Helped-by: Rui Abreu Ferreira <raf-ep@gmx.com>
2017-01-19 09:55:57 +01:00
rover
d204cbc0ce buffer.c: use a map instead of hashtab 2017-01-19 12:08:08 +08:00
lonerover
0060974b2b vim-patch:7.4.2081
Problem:    Line numbers in the error list are not always adjusted.
Solution:   Set b_has_qf_entry properly. (Yegappan Lakshmanan)

c1542744e7
2017-01-19 10:51:58 +08:00
lonerover
86f76108f7 vim-patch:7.4.2067
Problem:    Compiler warning for char/char_u conversion. (Tony Mechelynck)
            Inefficient code.
Solution:   Use more lines to fill with spaces. (Nikolai Pavlov) Add type cast.

16ec3c9be3
2017-01-19 10:51:39 +08:00
lonerover
480b02fdb2 vim-patch:7.4.2064
Problem:    Coverity warns for possible buffer overflow.
Solution:   Use vim_strcat() instead of strcat().

4f5c5f2980
2017-01-19 10:11:53 +08:00
lonerover
827f2f9f6b vim-patch:7.4.2050
Problem:    When using ":vimgrep" may end up with duplicate buffers.
Solution:   When adding an error list entry pass the buffer number if possible.

015102e91e
2017-01-19 10:11:53 +08:00
lonerover
1a06a39488 vim-patch:7.4.2049
Problem:    There is no way to get a list of the error lists.
Solution:   Add ":chistory" and ":lhistory".

f6acffbe83
2017-01-19 10:11:53 +08:00
James McCoy
75e6af44e0 Merge pull request #5963 from jamessan/screen-expect-clarity
test: screen: Assert expected row count matches configured screen height
2017-01-18 15:16:07 -05:00
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
James McCoy
e2b031a342 test: screen_basic: Re-enable min width/height test 2017-01-18 11:24:39 -05:00
James McCoy
4322021bae test: screen: Assert expected row count matches configured screen height
When there is a difference in expected vs. actual row count, the user
gets a confusing message about being unable to string concat a nil value
from screen:expect.

This assert makes it clear what the problem is rather than requiring
people to dig through the code of screen:expect to determine what
happened.
2017-01-18 11:24:34 -05:00
Matthew Malcomson
b7ee8fbc81 put fixup, esp. ". register close #5709 #5781
Note some bugs were judged to have too ugly a fix to solve, tests to
demonstrate these problems, and the explanation behind not fixing them
are below.

describe('register . problems', function()
  before_each(reset)

  -- The difficulty here is: The basic requirement is that the text
  -- inserted is treated as if it were typed in insert mode. This is why
  -- the paste method is to enter insert mode and enter the ". register
  -- into readbuf1.
  -- We can't add a count into the readbuf here because the insert mode
  -- count is implemented with readbuf2 which is checked for characters
  -- after readbuf1.
  -- Hence, the ".gp command (which adds extra characters into readbuf1
  -- to emulate leaving the cursor after the text by moving the cursor
  -- after inserting the text) would insert the motion characters into
  -- the buffer instead of using them to move after the insert has been
  -- done.
  -- I could probably get this working properly with a special flag put
  -- into start_redo_ins() and set in do_put(), but I think this adds
  -- much more complexity than fixing this bug justifies.
  pending('should not change the ". register with ".2p', function()
    local orig_register = funcs.getreg('.')
    feed('2".p')
    eq(orig_register, funcs.getreg('.'))
  end)

  describe("cursor positioning after undo and redo with '.'", function()
    before_each(reset)
    local function make_cursor_test(macro_string)
      return function()
        feed(macro_string)
        local afterpos = funcs.getcurpos()
        local orig_string = curbuf_contents()
        feed('u.')
        eq(afterpos, funcs.getcurpos())
        expect(orig_string)
      end
    end
    -- The difficulty here is: setting the cursor after the end of the
    -- pasted text is done by adding a motion command to the
    -- stuffbuffer after the insert.
    -- Modifying 'redobuff' is done in the code that handles inserting
    -- text and moving around.
    -- I could add a special case in ins_esc() that checks for a flag
    -- set in do_put() to add the motion character to the redo buffer,
    -- but I think that is starting to get way too convoluted for the
    -- benefit.
    pending('should be the same after ".gp and ".gpu.',
            make_cursor_test('".gp'))
    -- The difficulty here is: putting forwards is implemented by using
    -- 'a' instead of 'i' to start insert.
    -- Undoing with 'u' an insert that began with 'a' leaves the cursor
    -- where the first character was inserted, not where the cursor was
    -- when the 'a' was pressed.
    -- We account for this the first time by saving the cursor position
    -- in do_put(), but this isn't stored in redobuff for a second time
    -- around.
    -- We can't change how such a fundamental action as undo after
    -- inserting with 'a' behaves, we could add in a special case
    -- whereby we set a flag in do_put() and read it when entering
    -- insert mode but this seems like way too much to fix such a minor
    -- bug.
    pending('should be the same after ".pu. and ".pu.u.',
            make_cursor_test('".pu.'))
  end)
end)
2017-01-18 12:28:10 +00: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