Commit Graph

1865 Commits

Author SHA1 Message Date
Justin M. Keyes
b9d6bda531 test: FocusGained: press-enter prompt 2017-09-05 18:44:01 +02:00
Justin M. Keyes
ff32bacb2e test: FocusGained: let UI settle before sending input
This significantly increases the likelihood that the :echo'd text will
be included in the next UI flush, instead of being lost.
2017-09-05 15:01:07 +02:00
Justin M. Keyes
6c53c3ee55 eventloop: restore redraw in cmdline K_EVENT handler
Restores behavior from commit: 02e86ef04cc1
2017-09-05 15:01:06 +02:00
Justin M. Keyes
4bf953cca4 test: FocusGained/FocusLost 2017-09-05 15:01:06 +02:00
Justin M. Keyes
f9af824832 test: use global_helpers.uname() instead of calling to nvim UUT 2017-09-05 15:01:06 +02:00
Justin M. Keyes
ce852bab04 eventloop: K_EVENT does not finish mapping
The "mapping" tests added in 541dde36e3 were flawed:
- Unlike op-pending mode, RPCs are _blocked_ during map-pending. So
  a synchronous RPC like nvim_get_current_buf() waits until
  'timeoutlen', then the mapping is canceled.
- helpers.expect() also performs a blocking RPC, so again that must not
  intervene the two nvim_input() calls.

closes #6166
2017-09-04 22:51:04 +02:00
Justin M. Keyes
3922237b14 test: lint 2017-09-04 10:46:10 +02:00
Matthew Malcomson
541dde36e3 eventloop: K_EVENT should not finish operator
normal_finish_command() and normal_prepare() assume that any pending
operator needs to be finished after any subsequent key.

Set `finish_op = false` in nv_event() to indicate that the pending
operator shouldn't be finished in normal_execute().

This is how nv_visual() indicates that 'v' or 'V' in operator-pending
mode should not finish the current pending operator.

fixes #5398
fixes #6166 (partially; mappings are still interrupted)
2017-09-04 08:20:04 +02:00
Matthieu Coudron
f612e99db5 ci: XXX: permissive termclose_spec timer (#7217)
We probably need to revisit the process_stop() logic.
In the meantime this hack avoids CI noise.
2017-08-26 17:18:46 +02:00
Justin M. Keyes
6e7a8c3fe2 Merge #7081 from justinmk/rpcstop
rpc: close channel if stream was closed
2017-08-26 16:41:35 +02:00
James McCoy
46a4099dfb Merge pull request #7192 from llorens/vim-8.0.0092
vim-patch:8.0.0092
2017-08-25 11:21:36 -04:00
Justin M. Keyes
85f3084e21 clipboard: disallow recursion; show hint only once (#7203)
- Show hint only once per session.
- provider#clipboard#Call(): prevent recursion
- provider#clear_stderr(): use has_key(), because :silent! is still
  captured by :redir.

closes #7184
2017-08-22 20:31:54 +02:00
Justin M. Keyes
7f7698649f Merge #6973 from teto/normal_hl 2017-08-22 20:01:50 +02:00
Matthieu Coudron
4d91369fd7 syntax.c: register 'Normal' highlight group
- :hi Normal works with -u NONE
- Makes HL_TABLE and ATTR_ENTYRY a function instead of a macro so that in can be used in gdb.
- Introduces ATTRENTRY_INIT to init attrentry_t
2017-08-22 12:37:59 +02:00
James McCoy
fc7bf1c71d
vim-patch:8.0.0437
Problem:    The packadd test does not create the symlink correctly and does
            not test the right thing.
Solution:   Create the directory and symlink correctly.

644df41c44
2017-08-21 20:29:49 -04:00
James McCoy
651c6f9b6e
vim-patch:8.0.0326
Problem:    Packadd test uses wrong directory name.
Solution:   Use the variable name value. (Hirohito Higashi)

24f8f543d4
2017-08-21 20:29:49 -04:00
James McCoy
24a5564196
vim-patch:8.0.0325
Problem:    Packadd test does not clean up symlink.
Solution:   Delete the link. (Hirohito Higashi)

913727e567
2017-08-21 20:29:48 -04:00
James McCoy
a66eca78c2
vim-patch:8.0.0308
Problem:    When using a symbolic link, the package path will not be inserted
            at the right position in 'runtimepath'. (Dugan Chen, Norio Takagi)
Solution:   Resolve symbolic links when finding the right position in
            'runtimepath'. (Hirohito Higashi)

2f9e575583
2017-08-21 20:29:48 -04:00
Lech Lorens
d2595ba1c4 vim-patch:8.0.0092
Problem:    C indenting does not support nested namespaces that C++ 17 has.
Solution:   Add check that passes double colon inside a name. (Pauli, closes
            vim/vim#1214)

ca8b8d6956
2017-08-21 23:00:51 +02:00
Drew Neil
73286a81cf Repair tui_spec functional tests 2017-08-21 20:44:03 +01:00
Drew Neil
ac52947838 Repair job_spec functional tests 2017-08-21 20:44:03 +01:00
Drew Neil
642e14d9e7 Repair ex_terminal_spec functional tests 2017-08-21 20:44:03 +01:00
Justin M. Keyes
af993da435 rpc: close channel if stream was closed
f_jobstop()/f_rpcstop() .. process_stop() .. process_close_in(proc)
closes the write-stream of a RPC channel. But there might be
a pending RPC notification on the queue, which may get processed just
before the channel is closed.

To handle that case, check the Stream.closed in
channel.c:receive_msgpack().

Before this change, the above scenario could trigger
this assert(!stream->closed) in wstream_write():

    0x00007f96e1cd3428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
    0x00007f96e1cd502a in __GI_abort () at abort.c:89
    0x00007f96e1ccbbd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x768f9b "!stream->closed",
    file=file@entry=0x768f70 "../src/nvim/event/wstream.c", line=line@entry=77,
    function=function@entry=0x768fb0 <__PRETTY_FUNCTION__.13735> "wstream_write") at assert.c:92
    0x00007f96e1ccbc82 in __GI___assert_fail (assertion=0x768f9b "!stream->closed", file=0x768f70 "../src/nvim/event/wstream.c", line=77,
    function=0x768fb0 <__PRETTY_FUNCTION__.13735> "wstream_write") at assert.c:101
    0x00000000004d2c1f in wstream_write (stream=0x7f96e0a35078, buffer=0x7f96e09f9b40) at ../src/nvim/event/wstream.c:77
    0x00000000005857b2 in channel_write (channel=0x7f96e0ae5800, buffer=0x7f96e09f9b40) at ../src/nvim/msgpack_rpc/channel.c:551
    0x000000000058567d in on_request_event (argv=0x7ffed792efa0) at ../src/nvim/msgpack_rpc/channel.c:523
    0x00000000005854c8 in handle_request (channel=0x7f96e0ae5800, request=0x7ffed792f1b8) at ../src/nvim/msgpack_rpc/channel.c:503
    0x00000000005850cb in parse_msgpack (channel=0x7f96e0ae5800) at ../src/nvim/msgpack_rpc/channel.c:423
    0x0000000000584f90 in receive_msgpack (stream=0x7f96e0a35218, rbuf=0x7f96e0d1d4c0, c=22, data=0x7f96e0ae5800, eof=false)
    at ../src/nvim/msgpack_rpc/channel.c:389
    0x00000000004d0b20 in read_event (argv=0x7ffed792f4a8) at ../src/nvim/event/rstream.c:190
    0x00000000004ce462 in multiqueue_process_events (this=0x7f96e18172d0) at ../src/nvim/event/multiqueue.c:150
    0x000000000059b630 in nv_event (cap=0x7ffed792f620) at ../src/nvim/normal.c:7908
    0x000000000058be69 in normal_execute (state=0x7ffed792f580, key=-25341) at ../src/nvim/normal.c:1137
    0x0000000000652463 in state_enter (s=0x7ffed792f580) at ../src/nvim/state.c:61
    0x000000000058a1fe in normal_enter (cmdwin=false, noexmode=false) at ../src/nvim/normal.c:467
    0x00000000005500c2 in main (argc=2, argv=0x7ffed792f8d8) at ../src/nvim/main.c:554

Alternative approach suggested by bfredl is to use close_cb of the
process. My unsuccessful attempt is below. (It seems close_cb is queued
too late, which is the similar problem addressed by this commit):

    commit 75fc12c6ab15711bdb7b18c6d42ec9d157f5145e
    Author: Justin M. Keyes <justinkz@gmail.com>
    Date:   Fri Aug 18 01:30:41 2017 +0200

        rpc: use Stream's close_cb instead of explicit check in receive_msgpack()

    diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c
    index 8371d3cd482e..e52da23cdc40 100644
    --- a/src/nvim/event/process.c
    +++ b/src/nvim/event/process.c
    @@ -416,6 +416,10 @@ static void on_process_exit(Process *proc)
     static void on_process_stream_close(Stream *stream, void *data)
     {
       Process *proc = data;
    +  ILOG("on_process_stream_close");
    +  if (proc->stream_close_cb != NULL) {
    +    proc->stream_close_cb(stream, proc->stream_close_data);
    +  }
       decref(proc);
     }

    diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h
    index 5c00e8e7ecd5..34a8d54f6f8c 100644
    --- a/src/nvim/event/process.h
    +++ b/src/nvim/event/process.h
    @@ -26,6 +26,11 @@ struct process {
       Stream *in, *out, *err;
       process_exit_cb cb;
       internal_process_cb internal_exit_cb, internal_close_cb;
    +
    +  // Called when any of the process streams (in/out/err) closes.
    +  stream_close_cb stream_close_cb;
    +  void *stream_close_data;
    +
       bool closed, detach;
       MultiQueue *events;
     };
    @@ -50,6 +55,8 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data)
         .closed = false,
         .internal_close_cb = NULL,
         .internal_exit_cb = NULL,
    +    .stream_close_cb = NULL,
    +    .stream_close_data = NULL,
         .detach = false
       };
     }
    diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c
    index 7c865bfe1e8c..c8720d1e45d9 100644
    --- a/src/nvim/event/stream.c
    +++ b/src/nvim/event/stream.c
    @@ -95,7 +95,11 @@ void stream_close(Stream *stream, stream_close_cb on_stream_close, void *data)
     void stream_close_handle(Stream *stream)
       FUNC_ATTR_NONNULL_ALL
     {
    +  ILOG("stream=%d", stream);
    +  // LOG_CALLSTACK();
       if (stream->uvstream) {
    +    // problem:  this schedules on the queue, but channel.c:receive_msgpack may
    +    // be processed before close_cb is called by libuv.
         uv_close((uv_handle_t *)stream->uvstream, close_cb);
       } else {
         uv_close((uv_handle_t *)&stream->uv.idle, close_cb);
    @@ -105,6 +109,7 @@ void stream_close_handle(Stream *stream)
     static void close_cb(uv_handle_t *handle)
     {
       Stream *stream = handle->data;
    +  ILOG(">>>>>>>>>>>>>>>>>>>>>>> stream=%p stream->internal_close_cb=%p", stream, stream->internal_close_cb);
       if (stream->buffer) {
         rbuffer_free(stream->buffer);
       }
    diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
    index 782eabe04e4a..dc2b794e366a 100644
    --- a/src/nvim/msgpack_rpc/channel.c
    +++ b/src/nvim/msgpack_rpc/channel.c
    @@ -128,6 +128,8 @@ uint64_t channel_from_process(Process *proc, uint64_t id, char *source)
                                           source);
       incref(channel);  // process channels are only closed by the exit_cb
       channel->data.proc = proc;
    +  channel->data.proc->stream_close_cb = close_cb2;
    +  channel->data.proc->stream_close_data = channel;

       wstream_init(proc->in, 0);
       rstream_init(proc->out, 0);
    @@ -387,17 +389,6 @@ static void receive_msgpack(Stream *stream, RBuffer *rbuf, size_t c,
         goto end;
       }

    -  if ((chan_wstream(channel) != NULL && chan_wstream(channel)->closed)
    -      || (chan_rstream(channel) != NULL && chan_rstream(channel)->closed)) {
    -    char buf[256];
    -    snprintf(buf, sizeof(buf),
    -             "ch %" PRIu64 ": stream closed unexpectedly. "
    -             "closing channel",
    -             channel->id);
    -    call_set_error(channel, buf, WARN_LOG_LEVEL);
    -    goto end;
    -  }
    -
       size_t count = rbuffer_size(rbuf);
       DLOG("ch %" PRIu64 ": parsing %u bytes from msgpack Stream: %p",
            channel->id, count, stream);
    @@ -571,23 +562,6 @@ static Stream *chan_wstream(Channel *chan)
       abort();
     }

    -/// Returns the Stream that a Channel reads from.
    -static Stream *chan_rstream(Channel *chan)
    -{
    -  switch (chan->type) {
    -    case kChannelTypeSocket:
    -      return &chan->data.stream;
    -    case kChannelTypeProc:
    -      return chan->data.proc->out;
    -    case kChannelTypeStdio:
    -      return &chan->data.std.in;
    -    case kChannelTypeInternal:
    -      return NULL;
    -  }
    -  abort();
    -}
    -
    -
     static bool channel_write(Channel *channel, WBuffer *buffer)
     {
       bool success = false;
    @@ -799,6 +773,12 @@ static void close_cb(Stream *stream, void *data)
       decref(data);
     }

    +static void close_cb2(Stream *stream, void *data)
    +{
    +  ILOG("close_cb2");
    +  close_channel(data);
    +}
    +
     /// @param source description of source function, rplugin name, TCP addr, etc
     static Channel *register_channel(ChannelType type, uint64_t id,
                                      MultiQueue *events, char *source)
2017-08-21 01:04:28 +02:00
Justin M. Keyes
88165a798e clipboard: test g:clipboard validation, fix a bug
Also fix `:help foo` highlighting in health.vim
2017-08-20 22:17:03 +02:00
Justin M. Keyes
cc7e344f83 clipboard: remove start_batch_changes() in redir_write()
start_batch_changes() doesn't avoid invoking the clipboard
once-per-line, because the loop is actually in ex_echo(), which calls
redir_write() for each message. But we've already entered
start_batch_changes() by then, so that was never the problem.

    redir_write at /home/vagrant/old.neovim/build/../src/nvim/message.c:2523
    msg_puts_attr_len at /home/vagrant/old.neovim/build/../src/nvim/message.c:1600
    msg_outtrans_len_attr at /home/vagrant/old.neovim/build/../src/nvim/message.c:1221
    ex_echo at /home/vagrant/old.neovim/build/../src/nvim/eval.c:19433
    do_one_cmd at /home/vagrant/old.neovim/build/../src/nvim/ex_docmd.c:2242

Trying to defer _explicit_ clipboard updates is difficult.
    :redir @+ | silent echo system('cat foo') | redir END
is essentially equivalent to:
    for l in readfile('foo')
        let @+ .= l
    endfor
We cannot make judgements about when to ignore a script's bad decisions.
start_batch_changes() only works around the case of clipboard=unnamed,
i.e. _implicit_ clipboard updates (`:g/foo/d`).  Not explicit
assignment.
2017-08-20 20:01:22 +02:00
Justin M. Keyes
9882e25dc4 clipboard: avoid error flood during :redir
redir_write():
- This is a "batch" operation which was not yet covered by
  start_batch_changes()

adjust_clipboard_name():
- msg() and friends during :redir will, of course, cause redir_write()
  to try to capture that message, which causes recursion.
- EMSG() here is trouble: if it interrupts :redir it is a mess.
  Rather than deal with the mess, show a non-error message.

closes #7182
closes #7184
closes #7183
ref #6048
ref #7032
2017-08-20 19:49:42 +02:00
Justin M. Keyes
9a6eb71eba test/win: give up on this one 2017-08-16 09:13:45 +02:00
Justin M. Keyes
dbb404542b test/win: place cursor at edge to tickle SIGWINCH 2017-08-16 09:13:44 +02:00
Justin M. Keyes
91c85a6378 test: tty-test.c: keep tty_out handle around
Now the window_split_tab_spec.lua test seems to work.
Also do some cleanup.
2017-08-16 09:13:44 +02:00
Justin M. Keyes
d2d76882f7 win/test: enable more :terminal tests
To deal with SIGWINCH limitations on Windows, change some resize tests
to _shrink_ the screen width. ... But this didn't work, so still
ignoring those tests on Windows.
2017-08-16 09:13:44 +02:00
Justin M. Keyes
e0763e94ad test: tty-test.c: restore win32 SIGWINCH handler 2017-08-16 09:13:44 +02:00
Justin M. Keyes
6a90f53862 test: cleanup 2017-08-16 09:13:44 +02:00
erw7
d3a8c4f992 win/pty: log errors 2017-08-16 09:13:44 +02:00
erw7
1614e805b3 win/test: tty-test: print screen size explicitly with CTRL-Q
tty-test.exe causes abnormal termination with low repeatability, try
changing it so as not to use SIGWINCH.
2017-08-16 09:13:44 +02:00
erw7
4b1f21de75 win: support :terminal 2017-08-16 09:13:43 +02:00
Justin M. Keyes
bb70eec177 Merge #6364 'command-line color hook' 2017-08-16 00:20:37 +02:00
ZyX
b1a8dcefee lua/executor: Fix crash when first string contains NUL and second not 2017-08-15 17:18:05 +03:00
ZyX
93ef823f5e lua/executor: Move stricmp to vim “module” and document it 2017-08-15 16:34:51 +03:00
ZyX
96b1600bc8 functests: Add test for stricmp 2017-08-15 16:34:25 +03:00
ZyX
19a28352a9 ex_getln: Make error messages look better 2017-08-14 01:56:48 +03:00
ZyX
0571b8cb0e functests: Alter comment 2017-08-14 01:22:10 +03:00
ZyX
a5449f79ac functests: Check that input is correctly silenced 2017-08-14 01:17:16 +03:00
Nikolai Aleksandrovich Pavlov
bf1b1ea6ee lua/executor: Fix crash when printing empty string (#7157) 2017-08-13 17:37:35 +02:00
James McCoy
ac055d677a os_stat: return ENOENT on NULL filename arg
Closes #4370

Explication:

    In the backtrace in #4370, we see that `buf_write()` was called with
    non-NULL `fname` and `sfname` arguments, but they've since _become_
    NULL.

    #7  0x00000000004de09d in buf_write (buf=0x1dee040, fname=0x0, fname@entry=0x1e985b0 "/home/sean/src/github.com/snczl/virta/pkg/meld/segment.go",
                                         sfname=0x0, sfname@entry=0x1ddfa60 "segment.go", start=1, end=72, eap=eap@entry=0x7ffc6b032e60, append=0,
                                         forceit=0, reset_changed=1, filtering=0)
    at /home/travis/build/neovim/bot-ci/build/neovim/src/nvim/fileio.c:2576

    This is most likely due to the code that restores those values from
    `buf`, which happens just before the fatal call to `os_fileinfo`

    ```c
        /*
         * The autocommands may have changed the name of the buffer, which may
         * be kept in fname, ffname and sfname.
         */
        if (buf_ffname)
          ffname = buf->b_ffname;
        if (buf_sfname)
          sfname = buf->b_sfname;
        if (buf_fname_f)
          fname = buf->b_ffname;
        if (buf_fname_s)
          fname = buf->b_sfname;
    ```

    It's worth noting that at this point `ffname` is still non-NULL, so
    it _could_ be used.  However, our current code is purely more strict
    than Vim in this area, which has caused us problems before (e.g.,
    `getdigits()`).  The commentary for `struct file_buffer` clearly
    indicate that all of `b_ffname`, `b_sfname`, and `b_fname` may be
    NULL:

    ```c
      /*
       * b_ffname has the full path of the file (NULL for no name).
       * b_sfname is the name as the user typed it (or NULL).
       * b_fname is the same as b_sfname, unless ":cd" has been done,
       *		then it is the same as b_ffname (NULL for no name).
       */
      char_u      *b_ffname;        /* full path file name */
      char_u      *b_sfname;        /* short file name */
      char_u      *b_fname;         /* current file name */
    ```

    Vim directly calls `stat(2)` which, although it is annotated to tell
    the compiler that the path argument is non-NULL, does handle a NULL
    pointer by returning a `-1` value and setting `errno` to `EFAULT`.
    This satisfies Vim's check, since it treats any `-1` return from
    `stat(2)` to mean the file doesn't exist (at least in this code
    path).

    Note that Vim's mch_stat() implementations on win32 and solaris
    clearly cannot accept NULL `name`. But the codepaths that call
    mch_stat will NULL `name` tend to be unix-only (eg: u_read_undo)!
2017-08-10 00:56:07 +02:00
ZyX
474aa823dc Merge branch 'master' into colored-cmdline 2017-08-06 15:25:17 +03:00
ZyX
efb03903eb functests: Remove wait() from input_spec 2017-08-06 14:43:46 +03:00
Justin M. Keyes
3827d5bc71 input: skip dialogs if no UI is active
Treat dialogs in the same way as "silent mode" (`nvim -es`).

References #1984
References #3901
2017-08-06 04:22:45 +02:00
Justin M. Keyes
30996359ef clint: allow starting brace after enum 2017-08-06 02:51:49 +02:00
Justin M. Keyes
efb0aca0ee test/helpers: disable powershell logo/banner message 2017-08-06 02:51:48 +02:00
Justin M. Keyes
a31482db4d terminal: block redraw during c_CTRL-D
Unlike the normal wildmenu, the CTRL-D wild-list is not restored by
statusline redraw. (Semantics: ^D is controlled by 'wildoptions' option,
so it's in the "wild..." family.)

TODO: externalize the c_CTRL-D wild-list.
2017-08-05 21:32:34 +02:00
Justin M. Keyes
c695443727 win_redr_status(): skip if wildmenu is showing
This might be too coarse, but it passes all tests ...

A more nuanced approach might be: only skip the windows whose
statuslines are overwritten by the wildmenu.

Closes #2255
Closes #7108

vim-patch:8.0.0710 N/A because of the changes in this commit.
2017-08-05 21:32:34 +02:00
Justin M. Keyes
92101947fe test: job_spec.lua: disable shada in test instance 2017-08-04 22:25:39 +02:00
ZyX
fbe60af538 Merge branch 'master' into colored-cmdline 2017-07-31 02:05:02 +03:00
ckelsel
5cd68b3900 vim-patch:8.0.0124 #7092
Problem:    Internal error for assert_inrange(1, 1).
Solution:   Adjust number of allowed arguments. (Dominique Pelle)

3421566376
2017-07-30 14:15:26 +02:00
Justin M. Keyes
3b45f676c0 menu_get(): doc 2017-07-28 02:34:24 +02:00
Matthieu Coudron
dc685387a3 viml: introduce menu_get() function #6322
menu_get({path}, {modes}). See :h menu_get.
2017-07-28 01:27:58 +02:00
ZyX
1011462b40 Revert "functests: Replace wait() with nvim_async"
This reverts commit e129607988.

Tests stopped working in CI.
2017-07-27 18:49:13 +03:00
ZyX
c5857e3f38 ex_getln: Cache highlight callback calling results 2017-07-26 22:56:48 +03:00
ZyX
e129607988 functests: Replace wait() with nvim_async 2017-07-26 22:04:39 +03:00
ZyX
1ba21b4a31 functests: Remove unneeded wait()s 2017-07-26 13:02:45 +03:00
ZyX
0a46ae3c0a functests: Add sleep to <C-c> test 2017-07-18 01:29:41 +03:00
ZyX
25f669049c functests: Test input() nesting support 2017-07-18 01:17:59 +03:00
ZyX
759f71d50e functests: Check for previously unchecked errors 2017-07-18 00:34:39 +03:00
ZyX
8a581b918b ex_getln: Check prev_prompt_errors before running redrawcmdline
Otherwise there will be infinite recursion and shortly a crash. Running 
redrawcmdline recursively occurs under color_cmdline_error label.
2017-07-18 00:20:21 +03:00
ZyX
cfb1d937a6 api helpers: Also save and restore did_emsg 2017-07-18 00:08:57 +03:00
ZyX
f4744e1821 ex_getln: Do not goto color_cmdline_end without first cleaning up
The issue with debug mode was actually not cleaning up after `try_enter`: 
location `&tstate` was pointing to got invalidated and received some “garbage” 
(actually, values that got stored on the stack afterwards). But pointer to that 
garbage was still stored in `msg_list`, so next attempt to check it resulted in 
a crash.
2017-07-17 01:55:10 +03:00
Justin M. Keyes
d72db1ac8f test: mouse_spec: remove obnoxious wait times (#7029)
helpers.skip_fragile() already skips the problematic tests
on the ASan build. But the 15s timeout plus 5s 'mousetime'
cause the tests to take 1+ minutes anyways.
2017-07-15 18:00:00 +02:00
ZyX
69719e658c Merge branch 'master' into colored-cmdline 2017-07-15 18:56:45 +03:00
Justin M. Keyes
d15317ece4 health.vim: fix test 2017-07-15 16:15:47 +02:00
James McCoy
d67e48379f
test: shada: Replace hard-coded 704 with dynamic version 2017-07-14 06:44:22 -04:00
Nikolai Aleksandrovich Pavlov
702c94aacf mbyte: Fix crash when using multibyte chars in maparg() return (#6986)
This is a refactoring typo from #6947.

Fixes #6985

Combined with #6947 where typo was made it also fixes vim/vim#1827 which was
present in Neovim.
2017-07-09 10:40:46 +02:00
KillTheMule
619838f85d inccommand: improve performance #6949
During a preview, we can stop looking for matches after we got enough
lines for the preview buffer.

Because of this perf improvement, the 'redrawtime' test needs to be
slowed down in a different way: _long_ lines instead of just many lines.
2017-07-08 17:51:42 +02:00
Justin M. Keyes
0ea7e45bc1 'cpoptions': remove "<" flag; ignore <special>
Closes #6937 "nvim_get_keymap output is unreliable"
2017-07-08 16:34:35 +02:00
d10n
69e9cda5ac i_CTRL-O: fix :startinsert at end of line (#6963)
The gchar_cursor() == NUL check is already done in ins_ctrl_o.
ins_esc changes gchar_cursor() so this if block is probably never
entered.

Issue:

Pressing CTRL-O in insert mode at the end of the line and typing
:startinsert moves the cursor 1 column back, when I expect the cursor
to remain at the end of the line

This is a regression from Vim behavior. Since at least Vim version 7.0,
Vim returns you to insert mode at the end of the line.

091e7d033c is the first bad neovim commit

Steps to reproduce using `nvim -u NORC`:
`aaaa<C-o>:startinsert<CR>`

Fixes #6962
2017-07-08 12:50:58 +02:00
James McCoy
773ea9dbdc Merge pull request #6823 from blueyed/fix-term-stop
fix SIGTERM/SIGHUP for jobs
2017-07-07 10:29:49 -04:00
James McCoy
5f5f2ce0de test: tui_spec: Remove unused is_linux variable 2017-07-07 10:07:53 -04:00
Daniel Hahler
f31c26f1af jobstop/process_stop: send SIGTERM directly
This reverts the revert of #6644 (7c1a5d1d4), and handles it properly
now (with tests).
2017-07-07 13:11:20 +02:00
Justin M. Keyes
105d680aea Merge #6816 'TUI improvements'
Removed these commits (test-suite changes):
e2fba01910
7c809c4bc7
18e7cd9e97
2017-07-07 00:34:37 +02:00
Justin M. Keyes
69f0847ccc Merge #6959 from ZyX-I/pvs-fixes 2017-07-04 23:50:57 +02:00
Justin M. Keyes
1b70a1da04 Merge #6958 from ZyX-I/fix-6957 2017-07-04 21:56:05 +02:00
ZyX
72b3fd9664 os/fileio: Add ability to use os/fileio.c for file descriptors
Code imported from #6299
2017-07-04 18:37:01 +03:00
ZyX
5ab9e9f617 os/fileio: Add msgpack_file_write function 2017-07-04 18:37:01 +03:00
ZyX
91b9ad7d82 shada: Make sure that code does not attempt to read too long items
Fixes #6957
2017-07-04 15:41:59 +03:00
ZyX
2208b64891 functests: Ensure different SIDs on successive source() calls 2017-07-04 15:15:23 +03:00
ZyX
480598dcda functests: Add some more :echo tests which also check for regression
Fixes #6954
2017-07-04 02:38:40 +03:00
ZyX
d113d3d737 functests: Make ex_cmds/echo actually use :echo 2017-07-04 02:22:26 +03:00
ZyX
b199194a2c functests: Copy eval/string_spec.lua to ex_cmds/echo_spec.lua 2017-07-04 02:06:04 +03:00
Justin M. Keyes
008b604bac Merge #6947 from ZyX-I/consistent-get_keymap 2017-07-03 23:33:08 +02:00
ZyX
35898cff5d unittests: Fix allocation ordering for tv_dict_add_str() 2017-07-02 20:24:39 +03:00
ZyX
d5916a823a functests: Test how spaces appear in get_keymap output 2017-07-02 20:08:00 +03:00
James McCoy
4d01725699
test: expand_env_esc: Pass correct buffer size for outlen and assertion
Running this test with a mocked passwd file whose $HOME was set to
/home/jamessan/src/debian.org/pkg-vim/deb-packages/neovim/neovim-0.2.0/debian/fakehome
caused the test to fail, since the expanded result was >= 99 bytes.  The
test should be reflecting the actual size of the buffer, instead of some
arbitrary other number, anwyay.
2017-07-02 12:52:43 -04:00
ZyX
5fe5d712aa functests: Use more extensive testing
Fixes #6937
2017-07-02 19:50:03 +03:00
ZyX
24f0056ca5 message: Add support for replacing < to str2special 2017-07-02 19:37:21 +03:00
ZyX
a1fee487ba functests: Add tests for new behaviour
Apparently it is not working yet.
2017-07-02 19:28:44 +03:00
ZyX
4b8bdd953e functests: Remove local_copy function 2017-07-02 19:21:21 +03:00
ZyX
df040e55fb eval/typval: Add tv_dict_add_allocated_str() function 2017-07-02 19:01:09 +03:00
Justin M. Keyes
ca4633bfe4 ci/quickbuild: XXX: disable server_requests test (#6851)
Temporarily disable this test which hangs quickbuild.

From #6905: The hang occurs when calling nvim_set_current_line.

References #6594 5a151555c8
2017-07-02 00:30:00 +02:00
KunMing Xie
57d691e81a test: handle single-char hostname (#6939) 2017-07-01 18:48:17 +02:00
ZyX
7ab152aaa5 ex_getln: Save and restore try state
Problem: when processing cycle such as

    :for pat in [' \ze*', ' \zs*']
    :  try
    :    let l = matchlist('x x', pat)
    :    $put ='E888 NOT detected for ' . pat
    :  catch
    :    $put ='E888 detected for ' . pat
    :  endtry
    :endfor

`:let l = …` throwing an error causes this error to be caught after 
color_cmdline attempts to get callback for highlighting next line (the one with 
`$put = 'E888 NOT…`). Saving/restoring state prevents this from happening.
2017-07-01 15:34:25 +03:00
ZyX
ea75966e42 ex_getln: Do not make <C-c> interrupt input() after interrupting hl cb 2017-06-28 22:54:13 +03:00
ZyX
3da49cd68e ex_getln: Fix “echoerr msg not shown” problem
This also attempted to fix problem with cancelling input() on error by avoiding 
standard error printing facilities (assumed thrown error message is the 
problem), but with no luck so far.
2017-06-28 22:09:10 +03:00
ZyX
9ccb3abbb5 functests: Uncomment {REDRAW} part of “works” test 2017-06-28 14:39:52 +03:00
ZyX
5e4976559a functests: Partially uncomment <C-c> test 2017-06-28 14:34:12 +03:00
ZyX
0ed95423de ex_getln: Call highlight callback inside :try 2017-06-28 14:26:23 +03:00
ZyX
493d250446 functests: Make “stops executing callback” test work
Needed to be adjusted to use input() (previously relied on side-effects of 
executing `:cmd`) and dismiss something (hidden “Press ENTER” message?).
2017-06-28 13:58:51 +03:00
ZyX
36a84d8f4a functests: Fix typo 2017-06-28 13:54:04 +03:00
James McCoy
91749c06dc Merge pull request #6927 from jamessan/vim-7.4.2259
vim-patch:7.4.2259,7.4.2268,7.4.2318,7.4.2320
2017-06-27 03:19:01 +00:00
James McCoy
54d5e90a2b
vim-patch:7.4.2320
Problem:    Redraw problem when using 'incsearch'.
Solution:   Save the current view when deleting characters. (Christian
            Brabandt) Fix that the '" mark is set in the wrong position. Don't
            change the search start when using BS.

dda933d06c
2017-06-26 22:08:13 -04:00
James McCoy
0dd6455659
vim-patch:7.4.2268
Problem:    Using CTRL-N and CTRL-P for incsearch shadows completion keys.
Solution:   Use CTRL-T and CTRL-G instead.

1195669f9e
2017-06-26 22:08:11 -04:00
James McCoy
518b42db91
functests/legacy: Add lua version of test_search.vim 2017-06-26 22:07:28 -04:00
Justin M. Keyes
f34befe74c Merge #6789 from ZyX-I/lua-path
lua: Add paths from &runtimepath to package.path and package.cpath
2017-06-27 02:29:15 +02:00
ZyX
edc2a7ee46 functests: Make tests work with input()
There are still some issues: specifically, new “pending” test hangs busted.
2017-06-27 02:15:49 +03:00
ZyX
8e5134784c functests: Comment out failing test 2017-06-27 01:55:21 +03:00
ZyX
71616fce0b functests: Abstract away some ways to enter cmdline coloring mode
Reason: should actually switch to using input() coloring because other coloring 
variants are eventually going away.
2017-06-27 01:54:08 +03:00
ZyX
95fe5614a0 functests: Add missing wait() 2017-06-27 01:34:54 +03:00
ZyX
407abb3a6c eval,ex_getln: Add support for coloring input() prompts 2017-06-27 01:34:54 +03:00
ZyX
d82741f8c0 ex_getln: Add some more tests, fix some found errors 2017-06-27 01:34:54 +03:00
ZyX
3d25200127 functests: Start adding some tests 2017-06-27 01:34:54 +03:00
ZyX
476c28f433 functests: Fix screen.lua supplying dedent additional argument 2017-06-21 10:58:47 +03:00
ZyX
ae457ff64a functests: Check that minimal distance between commands works 2017-06-21 10:58:47 +03:00
ZyX
607dc3e0f9 functests: Add tests 2017-06-21 10:58:47 +03:00
ZyX
d5839770ee functests: Refactor redir_exec 2017-06-20 18:17:47 +03:00
ZyX
e57d4eef88 functests: Move function_spec to eval 2017-06-20 18:17:47 +03:00
Björn Linse
16ae369474 screen.c: make more highlights window specific 2017-06-14 20:31:14 +02:00
HiPhish
9f534f338a mksession: Restore tab-local working directory #6859
The ':tcd' command is the first tab-specific command written to the file
and it is wrapped inside an 'if has('nvim')' block to keep the session
file compatible with Vim.

Closes #6678
2017-06-11 15:51:53 +02:00
Justin M. Keyes
16cce1ac17 Merge #6827 'Always enable logging' 2017-06-07 23:19:02 +02:00
James McCoy
bf4de3f6f7
functests/msgpack: Correct representation of literal INT64_MIN
In order to generate INT64_MIN from literal values, it's necessary to
use "-0x7fffffffffffffff - 1".  Using "-0x8000000000000000" causes the
value to get clamped to INT64_MAX and then negated.
2017-06-06 21:38:31 -04:00
James McCoy
d69286c065
functests/msgpack: Use assert_equal() for more informative errors 2017-06-06 21:38:30 -04:00
Justin M. Keyes
b4b09afabd test: iswin(): detect without nvim session 2017-06-07 00:27:26 +02:00
Justin M. Keyes
d07661b9a3 log: Fall back to CWD-relative .nvimlog
If if the resolved $NVIM_LOG_FILE *and* stdpath("data")/log cannot be
created (e.g. because the XDG data directory does not exist), fall back
to .nvimlog in the current direcrtory.
2017-06-07 00:27:26 +02:00
Justin M. Keyes
bb96b8219d log: set $NVIM_LOG_FILE; fallback to $XDG_DATA_HOME/nvim/log 2017-06-07 00:26:56 +02:00
Justin M. Keyes
698ec9eb6e loop_close: Avoid infinite loop, and log it.
Avoids a hang, and also helps diagnose issues like:

https://github.com/neovim/neovim/pull/6594#issuecomment-298321826
2017-06-07 00:26:21 +02:00
James McCoy
d707b2a171
vim-patch:8.0.0478
Problem:    Tests use assert_true(0) and assert_false(1) to report errors.
Solution:   Use assert_report().

37175409d7
2017-06-06 06:15:16 -04:00
Jonathan de Boyne Pollard
86d796656c tui: Correct commentary on tmux colour tests. 2017-06-03 18:53:29 +01:00
Jonathan de Boyne Pollard
1c1231bf13 tui: Add built-in terminfo entry for VTE.
Also slightly refactor the way in which GNOME/MATE Terminal pretending to be
xterm is detected.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
5377de33ac tui: Add st to the always 256-colour capable list.
Also comment and augment some terminal colour tests.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
3f8dedd7ae tui: Correct a copy and paste error in stterm tests.
The test decsription was correct; the test was not.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
8f60395dd1 tui: Update colour tests some more. 2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
e6cbb01b55 tui: Update colour tests. 2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
838277e28a test: fix bashisms (#6791) 2017-06-01 00:46:00 +02:00
Justin M. Keyes
133f8bc628 Merge #4700 from AdnoC/keep-default-register 2017-05-31 23:43:40 +02:00
AdnoC
5908f562df test: Fix and add cases for unnamed register
Also:

Add ru to shada tests with all keys

Add test for unset unnamed and register 0
2017-05-31 13:31:05 -04:00
AdnoC
beca4dc16c eval/shada: Add testing for unnamed register with setreg and startup 2017-05-31 13:19:08 -04:00
Matthew Malcomson
033b1cb7d9 'pastetoggle': Revert support for multi-key value (#6724)
Reverts commit 337b6179df

Closes #6716 at the expense of not being able to use a
multi-key 'pastetoggle' manually.

Multi-key 'pastetoggle' can still be used when inserting the entire
option into the typebuffer at once (though the use here is
questionable).

Also remove those tests to do with waiting for the completion of
'pastetoggle' and mention in the documentation that 'pastetoggle'
doesn't wait for timeout.
2017-05-31 13:20:06 +02:00
Björn Linse
5a151555c8 sockets: don't deadlock when connecting to own pipe address 2017-05-29 19:02:49 +02:00
Björn Linse
6a75938758 channels: implement sockopen() to connect to socket
Helped-By: oni-link <knil.ino@gmail.com>
2017-05-29 19:02:49 +02:00
ZyX
a409fa2b3f lua: Use automatic determining of suffixes only for package.cpath 2017-05-28 23:55:51 +03:00
James McCoy
9cc185dc6d Merge pull request #6680 from mhinz/listen/localhost
Use uv_getaddrinfo() for servers
2017-05-28 13:26:06 +00:00
James McCoy
6c135b89ee
eval: serverstart: Return finalized address to user
In the process of setting up the socket watcher, the address may be
changed (e.g., adding the OS-selected port).
2017-05-28 07:14:49 -04:00
ZyX
97602371e6 lua: Add paths from &runtimepath to package.path and package.cpath 2017-05-25 16:27:40 +03:00