Commit Graph

2402 Commits

Author SHA1 Message Date
Justin M. Keyes
7a13611ba2
Merge #8276 'startup: Make -s - read from stdin' 2018-04-17 10:33:36 +02:00
Justin M. Keyes
48967695c4
test: tui_spec.lua: relax test (#8289)
Sometimes an extra FocusGained/FocusLost event might trigger. This
doesn't matter, we just want to test that the events were received in
cmdline-mode.
2018-04-16 23:35:58 +02:00
Andrew Pyatkov
84359a467f terminal: resize to the max dimensions (#8249)
closes #8096
2018-04-16 22:25:23 +02:00
Justin M. Keyes
b2c066409d job-control: children_kill_cb(): do not check elapsed time
1. Don't check elapsed time in children_kill_cb(), it's already implied
   by the start-time of the timer itself.
2. Restart timer from children_kill_cb() for PTY jobs, to send SIGKILL
   after SIGTERM. There is an edge case where SIGKILL might follow
   SIGTERM too quickly, if jobstop() is called near the 2-second timer
   window.  But this edge case is not worth code complication.
2018-04-15 18:23:11 +02:00
Justin M. Keyes
7598e6cf17
Merge #8120 'test: win: prefer cmd.exe' 2018-04-15 18:16:37 +02:00
ZyX
f8d574225b eval: Silence PVS/V547: E882 may be triggered
I failed to deduce why analyzer thinks E882 may not be triggered, though 
conditions for triggering it are strange: it would trigger E882 only in the 
single case “function returned non-number”. Cases “function thrown exception”, 
or “built-in sorter encountered error” will neither yield E882 nor stop 
sort()/uniq().

Note though that searching test code revealed that neither E702 nor E882 are not 
tested anywhere.
2018-04-15 18:45:12 +03:00
geekodour
1e71978cf0 events: VimSuspend, VimResume #8280
closes #3648
ref #5959
2018-04-15 15:05:02 +02:00
Justin M. Keyes
1e7d5e8cdf
Merge #6272 'stdpath()' 2018-04-15 04:09:30 +02:00
Jan Edmund Lazo
5abfa94ed2 test: win: use "start" to test backgrounded job (#8171) 2018-04-15 02:43:18 +02:00
b-r-o-c-k
387fbcd95c win: Fix reading from stdin
* Reading from stdin on Windows is fixed in the same way as it was in
  #8267.
* The file_read function was returning without filling the
  destination buffer when it was called with a non-blocking file
  descriptor.
2018-04-14 14:21:36 -05:00
b-r-o-c-k
ad999eaa77 Merge branch 'master' into s-dash-stdin 2018-04-14 14:17:51 -05:00
Justin M. Keyes
1c3a849881
API/nvim_command_output: handle :echon capture (#8265)
ref https://github.com/neovim/python-client/pull/290
2018-04-13 00:49:37 +02:00
Björn Linse
aea079a25d channels: delay free so that libuv can cleanup handles
add test for a crash this caused
2018-04-12 18:22:47 +02:00
Justin M. Keyes
87f4d2592c
test/util: expect_err() (#8257)
other cleanup, ref #8245
2018-04-11 22:07:00 +02:00
Justin M. Keyes
704ba4151e server: init v:servername if $NVIM_LISTEN_ADDRESS is invalid
Before this change, if $NVIM_LISTEN_ADDRESS was invalid, v:servername
was left empty.
2018-04-11 02:41:05 +02:00
Justin M. Keyes
507bda1c95 server: introduce --listen, deprecate $NVIM_LISTEN_ADDRESS 2018-04-11 02:41:05 +02:00
Justin M. Keyes
9f598e5765 serverstop(): return FALSE for invalid address 2018-04-11 01:58:41 +02:00
Justin M. Keyes
b11b681289 test/util: matches() 2018-04-11 01:58:41 +02:00
Justin M. Keyes
fa6415f13f
test/API: validate channel arg (#8245) 2018-04-08 03:01:15 +02:00
Justin M. Keyes
e8c39f72fd
Merge #8226 from justinmk/insert-mode-meta 2018-04-04 04:36:13 +02:00
Justin M. Keyes
224ebc0078 insert-mode: interpret unmapped META as ESC
closes #2454
closes #8213
ref #7972
2018-04-04 03:23:15 +02:00
Björn Linse
60e96a45b4 screen: winhl=Normal:Background should not override syntax (#8093)
fixes #7375
2018-04-02 14:21:14 +02:00
Justin M. Keyes
0c59ac1a2c
Merge #5908 'shada: Also save numbered marks' 2018-04-02 12:01:00 +02:00
ZyX
5d9bb16d66 functests: Use proper path in eq() 2018-04-02 11:14:11 +03:00
James McCoy
ec459965f5
test/options: Fix stdpath() failures on Windows 2018-04-01 22:40:20 -04:00
ZyX
dd1b493f75 shada: Fix some memory leaks and completely ignore numbered mark names
Problems:
- In two places in shada_read_when_writing() memory just was not freed. Both 
  places were verified to cause test failures.
- Numbered marks got assigned incorrect (off-by-one compared to position in the 
  array) numbers in replace_numbered_mark.
- It was possible to have non-continuously populated array of numbered marks 
  which messed up code for merging them.

(Note about tests: marks with additional data are always compared different when 
merging, that caused some confusion regarding why test did not work the way 
I expected.)
2018-04-01 21:29:47 +03:00
ZyX
1ac1f520f0 functests: Add test for merging with file with only numeric mark
Known to cause memory leak, but not an expected crash.
2018-04-01 20:04:35 +03:00
Björn Linse
98e7112390 msg: do not scroll entire screen (#8088) 2018-03-31 11:12:27 +02:00
Christian Höltje
868b84199e eval: Add stdpath() method (#5297)
Adds the :stdpath method for fetching XDG standard directories.

Fixes #5297
2018-03-29 10:41:04 -04:00
James McCoy
79f9c2d9c6
Merge branch 'master' into yagebu/option-fixes 2018-03-28 21:54:39 -04:00
Justin M. Keyes
3f3de9b1a9
Merge #8183 'build/msvc: Fix functional tests'
MSBuild still returns a non-zero exit code because it detects the word "error" in the stdout which is caused by some of the test names such as api/buf {get,set,del}_line get_line : out-of-bounds is an error. 

CMake mailing list thread:
https://cmake.org/pipermail/cmake-developers/2015-October/026775.html

There isn't any good solution for it, so I modified the build script to detect the error message printed by RunTests.cmake.
2018-03-27 23:02:27 +02:00
Nimit Bhardwaj
8d5a46e77b TUI: implement "standout" attribute #8081
closes #8054
2018-03-27 04:38:19 +02:00
ZyX
920c582320 test/helpers: Support booleans 2018-03-27 01:35:21 +03:00
ZyX
17ea0f2214 functests: Fix existing functional tests 2018-03-27 01:33:59 +03:00
b-r-o-c-k
ab6051331c build/msvc: Fix check for cksum on Windows 2018-03-26 10:54:44 -05:00
Jan Edmund Lazo
51f5cfc16e test: win: enable jobpid() tests
Use ping to test job detach
Use find.exe as an alternative to cat.exe
Use nvim_get_proc to check pid
2018-03-26 01:45:42 -04:00
Jan Edmund Lazo
ad6d577314 fixup: ping.exe works with cmd.exe pipe 2018-03-26 01:45:41 -04:00
Jan Edmund Lazo
e6ee06ee11 Revert "test/win: use cmd.exe for test"
This reverts commit ae409b5042.

This PR (#8120) defaults to cmd.exe for job_spec.lua
2018-03-26 01:45:41 -04:00
Jan Edmund Lazo
03e69a5d9c test: win: use find.exe /v "" as alternative cat - 2018-03-26 01:45:40 -04:00
Jan Edmund Lazo
3bd555f1e6 test: win: try stderr callback and slow output 2018-03-26 01:45:38 -04:00
Jan Edmund Lazo
cf4fbb6f04 test: win: use powershell for Start-Sleep only
cmd.exe (shell) is faster and more reliable than powershell (.NET frontend).
It's best for short and basic tests that don't require non-trivial scripting.
cmd.exe doesn't support sleep so use powershell's Start-Sleep as substitute.
2018-03-26 01:45:37 -04:00
ZyX
79b4b6fc86 *: Make sure that !did_throw implies !current_exception
Fixes #7876
2018-03-25 14:50:48 +03:00
Nimit Bhardwaj
8d64a2fb1d test: lua test for vim-patch:8.0.0184
2b7bc567b9
2018-03-24 23:06:09 +01:00
Jan Edmund Lazo
131aad953c win: defaults: 'shellcmdflag', 'shellxquote' #7343
closes #7698

Wrapping a command in double-quotes allows cmd.exe to safely dequote the
entire command as if the user entered the entire command in an
interactive prompt. This reduces the need to escape nested and uneven
double quotes.

The `/s` flag of cmd.exe makes the behaviour more reliable:

    :set shellcmdflag=/s\ /c

Before this patch, cmd.exe cannot use cygwin echo.exe (as opposed to
cmd.exe `echo` builtin) even if it is wrapped in double quotes.

Example:
:: internal echo
> cmd /s /c " echo foo\:bar" "
foo\:bar"

:: cygwin echo.exe
> cmd /s /c " "echo" foo\:bar" "
foo:bar
2018-03-24 22:05:53 +01:00
Justin M. Keyes
6a7c904648
Merge #4419 'implement <Cmd> key' 2018-03-24 17:45:48 +01:00
Justin M. Keyes
7ae4144208 refactor/rename: path_try_shorten_fname() 2018-03-24 14:17:40 +01:00
Justin M. Keyes
998a16c926 refactor/rename: path_is_absolute() 2018-03-24 14:17:40 +01:00
Justin M. Keyes
189c5abeba provider/RPC: apply_autocmds_group(): fix double-free
During provider dispatch, eval_call_provider() saves global
state--including pointers, such as `autocmd_fname`--into
`provider_caller_scope` which is later restored by f_rpcrequest().

But `autocmd_fname` is special-cased in eval_vars(), for performance
(see Vim patch 7.2.021; this is also the singular purpose of the
`autocmd_fname_full` global. Yay!)

If eval_vars() frees `autocmd_fname` then its provider-RPC-scoped alias
becomes a problem.

Solution: Don't free autocmd_fname in eval_vars(), just copy into it.

closes #5245
closes #5617

Reference
------------------------------------------------------------------------

Vim patch 7.2.021
f6dad43c98
Problem:    When executing autocommands getting the full file name may be
            slow. (David Kotchan)
Solution:   Postpone calling FullName_save() until autocmd_fname is used.

vim_dev discussion (2008): "Problem with CursorMoved AutoCommand when
Editing Files on a Remote WIndows Share"
https://groups.google.com/d/msg/vim_dev/kj95weZa_eE/GTgj4aq5sIgJ
2018-03-24 11:01:24 +01:00
Björn Linse
d407a48665 getchar: implement <Cmd> key to invoke command in any mode 2018-03-23 14:01:49 +01:00
Justin M. Keyes
ae409b5042 test/win: use cmd.exe for test
Can revert this after #8120.
2018-03-18 17:15:06 +01:00
Justin M. Keyes
167898a517 test: jobstop() kills entire process tree
Test correctly fails before 8d90171f8b.
ref #6530
2018-03-18 17:03:05 +01:00
Justin M. Keyes
a034d4b69d API: nvim_get_proc()
TODO: "exepath" field (win32: QueryFullProcessImageName())

On unix-likes `ps` is used because the platform-specific APIs are
a nightmare.  For reference, below is a (incomplete) attempt:

diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c
index 09769925aca5..99afbbf290c1 100644
--- a/src/nvim/os/process.c
+++ b/src/nvim/os/process.c
@@ -208,3 +210,60 @@ int os_proc_children(int ppid, int **proc_list, size_t *proc_count)
   return 0;
 }

+/// Gets various properties of the process identified by `pid`.
+///
+/// @param pid Process to inspect.
+/// @return Map of process properties, empty on error.
+Dictionary os_proc_info(int pid)
+{
+  Dictionary pinfo = ARRAY_DICT_INIT;
+#ifdef WIN32
+
+#elif defined(__APPLE__)
+  char buf[PROC_PIDPATHINFO_MAXSIZE];
+  if (proc_pidpath(pid, buf, sizeof(buf))) {
+    name = getName(buf);
+    PUT(pinfo, "exepath", STRING_OBJ(cstr_to_string(buf)));
+    return name;
+  } else {
+    ILOG("proc_pidpath() failed for pid: %d", pid);
+  }
+#elif defined(BSD)
+# if defined(__FreeBSD__)
+#  define KP_COMM(o) o.ki_comm
+# else
+#  define KP_COMM(o) o.p_comm
+# endif
+  struct kinfo_proc *proc = kinfo_getproc(pid);
+  if (proc) {
+    PUT(pinfo, "name", cstr_to_string(KP_COMM(proc)));
+    xfree(proc);
+  } else {
+    ILOG("kinfo_getproc() failed for pid: %d", pid);
+  }
+
+#elif defined(__linux__)
+  char fname[256] = { 0 };
+  char buf[MAXPATHL];
+  snprintf(fname, sizeof(fname), "/proc/%d/comm", pid);
+  FILE *fp = fopen(fname, "r");
+  // FileDescriptor *f = file_open_new(&error, fname, kFileReadOnly, 0);
+  // ptrdiff_t file_read(FileDescriptor *const fp, char *const ret_buf,
+  //                     const size_t size)
+  if (fp == NULL) {
+    ILOG("fopen() of /proc/%d/comm failed", pid);
+  } else {
+    size_t n = fread(buf, sizeof(char), sizeof(buf) - 1, fp);
+    if (n == 0) {
+      WLOG("fread() of /proc/%d/comm failed", pid);
+    } else {
+      size_t end = MIN(sizeof(buf) - 1, n);
+      end = (end > 0 && buf[end - 1] == '\n') ? end - 1 : end;
+      buf[end] = '\0';
+      PUT(pinfo, "name", STRING_OBJ(cstr_to_string(buf)));
+    }
+  }
+  fclose(fp);
+#endif
+  return pinfo;
+}
2018-03-18 00:11:45 +01:00
Justin M. Keyes
dbad797edd API: nvim_get_proc_children()
ref https://github.com/libuv/libuv/pull/836
2018-03-16 10:55:12 +01:00
Justin M. Keyes
de47515477 test: use luv.now() instead of os.time() 2018-03-16 10:55:12 +01:00
Marco Hinz
cca407b43e DirChanged: support <buffer> (#8140) 2018-03-16 07:29:20 +01:00
Matthew Malcomson
cc58ec9a80 Update documentation
Update vim_diff.txt with :lmap differences, update documentation on
'keymap', and add tests.

The tests added are to demonstrate the behaviour specified in the
documentation of :loadkeymap.
2018-03-14 10:39:14 +00:00
Matthew Malcomson
3b304fc04a 'keymap' now uses :lmap instead of :lnoremap
This means that the major way that :lmap mappings are applied works as
one would expect with macros.
This also means that having a translation with 'keymap' does not
preclude using mappings in insert mode with :imap.
2018-03-14 10:39:14 +00:00
Matthew Malcomson
d989051220 Split :lnoremap test into done and pending
There is some behaviour that we keep with the recent changes, and some
behaviour that we change.
Instetad of having one failing test covering  all behaviour, we split
the test into two.
2018-03-14 10:39:14 +00:00
Matthew Malcomson
e01f35c4bb :lnoremap mappings should not be remapped when replaying a recording 2018-03-14 10:39:14 +00:00
Matthew Malcomson
20bfe0f2a3 Account for :lmap in macros
close #5652
Start by adding some tests
2018-03-14 10:39:14 +00:00
Matthew Malcomson
1aefbff641 Add some basic tests for macros 2018-03-14 10:39:14 +00:00
Justin M. Keyes
496b0f944f test: next_msg(): default timeout to 10s
Infinite timeout results in hangs which waste time. If some test needs
longer than 10s to wait for a message, it should specify the timeout
explicitly.
2018-03-11 12:43:42 +01:00
Justin M. Keyes
fd4021387e test: rename next_message() to next_msg() 2018-03-11 12:43:42 +01:00
Justin M. Keyes
2bf0869160 test: handle non-deterministic message cadence 2018-03-11 12:43:42 +01:00
Justin M. Keyes
9cefd83cc7
Merge #8084 'build/win: support MSVC' 2018-03-08 20:26:18 +01:00
b-r-o-c-k
c29a82c45f build/msvc: Make shell-test fix only apply to MSCV 2018-03-06 20:38:10 -06:00
b-r-o-c-k
773f23e00d build/msvc: Make shell-test work
MSVC doesn't have unistd.h or usleep() so it was replaced with the
Sleep() WinAPI function.
2018-03-04 17:44:23 -06:00
Björn Linse
cee9a8ce8a message: don't output unprintable chars to screen
fixes #7586 #8070
2018-03-04 08:37:57 +01:00
geekodour
9f994bb699 api: nvim_list_uis #8004
ref #7438
closes #4842
2018-03-03 15:06:24 +01:00
James McCoy
158f8b7ce3 unittest: Ignore all _Float-prefixed types (#8067)
Previously, we ignored only _Float128. But glibc 2.27 added _Float32
and _Float32x.  Rather than play whack-a-mole, ignore everything.
2018-02-25 10:23:12 +01:00
Matthieu Coudron
384a39479a 'fillchars': fix defaults logic; handle ambiwidth=double #7986
Update tests.
2018-02-23 00:48:35 +01:00
Björn Linse
c57d315963
Merge pull request #8031 from bfredl/gotintstatus
jobwait: return -2 on interrupt even with timeout
2018-02-20 15:15:06 +01:00
Björn Linse
04fdbfe17d jobwait: return -2 on interrupt also with timeout 2018-02-20 12:32:23 +01:00
Jan Edmund Lazo
7fa69fb288 Resolve issues mentioned in PR review 2018-02-19 07:10:47 -05:00
Jan Edmund Lazo
795da343bb test: win: emulate yes with for loop 2018-02-19 07:10:46 -05:00
Jan Edmund Lazo
07dfe0f5ea test: win: enable ui/wildmode_spec.lua 2018-02-19 07:10:46 -05:00
Jan Edmund Lazo
8dcfd58e2c test: win: enable termclose_spec.lua 2018-02-19 07:10:46 -05:00
Jan Edmund Lazo
d80bf3c656 test: enable ex_cmds/cd_spec.lua on Windows 2018-02-19 07:10:46 -05:00
Jan Edmund Lazo
df99ab461e test: enable legacy/fixeol_spec in Windows
Try nvim's delete() for cross-platform file remove in Windows
2018-02-19 07:10:45 -05:00
Jan Edmund Lazo
55ce6bfffb test: enable ex_cmds/write_spec.lua in Windows 2018-02-19 07:10:45 -05:00
Jan Edmund Lazo
6beb7ee77a win: enable legacy test 051 2018-02-19 07:10:44 -05:00
Jan Edmund Lazo
f1e6828b7b win: enable legacy test 059 2018-02-19 07:10:44 -05:00
Jan Edmund Lazo
2943056f75 win: enable legacy test 107 2018-02-19 07:10:44 -05:00
Jan Edmund Lazo
44dc8b4753 win: enable legacy test 093 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
10fbae086a win: enable legacy/arglist_spec.lua 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
18a53b6502 win: enable legacy test 30 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
c5a7f451ce win: enable legacy/getcwd_spec.lua 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
3c0cc9c2fb win: enable legacy/wordcount_spec.lua 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
e55de56a99 win: enable legacy/packadd_spec.lua 2018-02-19 07:10:42 -05:00
Jan Edmund Lazo
f4d82c1438 win: enable legacy test 011 2018-02-19 07:10:42 -05:00
Jan Edmund Lazo
4f65cd7c0a win: enable legacy/delete_spec.lua 2018-02-19 07:10:42 -05:00
Jan Edmund Lazo
bde32edefe win: enable legacy test 097 2018-02-19 07:10:42 -05:00
Jan Edmund Lazo
0fd899aa07 win: enable legacy test 025 2018-02-19 07:10:41 -05:00
Jan Edmund Lazo
3e19e18f4c win: enable job tests that use jobstart only
- echo "" does not hang in powershell
    - cmd.exe's echo command does not hang.
    - job tests default to powershell (WHY?)
- wait 5 seconds for powershell to create an empty file
    - powershell is slow
    - cannot reliably validate the id returned by jobstart via jobpid, jobstop
    - if using cmd.exe, waiting for a second should be enough
- remaining job tests are unreliable in Windows because any build can pass/fail
  for same conditions without changes, especially if the error is in stderr
2018-02-19 07:10:41 -05:00
Shougo
00665d3c70 vim-patch:8.0.1493: completion items cannot be annotated (#8003)
Problem:    Completion items cannot be annotated.
Solution:   Add a "user_data" entry to the completion item. (Ben Jackson,
            coses vim/vim#2608, closes vim/vim#2508)

9b56a57cda
2018-02-18 23:56:59 +01:00
Justin M. Keyes
7973847d02 test/util: remove eq_any()
It was added in the parent commit, but ended up not being used. And
I can't think of a case where it will be used: instead we would probably
want to generalize expect_msg_seq() if necessary.
2018-02-18 19:22:44 +01:00
Justin M. Keyes
e72ecdb7ca test/util: expect_msg_seq()
job_spec.lua on AppVeyor (Windows) often fails like this:

      FAILED  ] C:/projects/neovim/test/functional\core\job_spec.lua @ 72: jobs changes to given `cwd` directory
    C:/projects/neovim/test/functional\core\job_spec.lua:81: Expected objects to be the same.
    Passed in:
    (table) {
      [1] = 'notification'
      [2] = 'stdout'
     *[3] = {
        [1] = 0
       *[2] = {
          [1] = 'C:\projects\neovim\Xtest-tmpdir\nvimmSjq1S\0' } } }
    Expected:
    (table) {
      [1] = 'notification'
      [2] = 'stdout'
     *[3] = {
        [1] = 0
       *[2] = {
          [1] = 'C:\projects\neovim\Xtest-tmpdir\nvimmSjq1S\0'
         *[2] = '' } } }
    stack traceback:

Message chunking is non-deterministic, so we need to try different
variants.
2018-02-18 19:19:03 +01:00
Nimit Bhardwaj
e9134421ab vim-patch-8.0.0649 and vim-patch-8.0.0650: autocmd open help 2 times 2018-02-17 00:02:16 +05:30
Björn Linse
77286915a8
Merge pull request #8008 from bfredl/arrayfree
ex_getln: clear cmdline_block after it's freed
2018-02-14 19:23:11 +01:00
Björn Linse
d9497053e8 ex_getln: clear cmdline_block after it's freed 2018-02-14 19:20:28 +01:00
Björn Linse
6e5cb0debd ui: refactor ui options 2018-02-13 20:48:51 +01:00
Justin M. Keyes
0f1bc5ddce test/python: less-noisy Python skip-message
Developer can use :checkhealth to get more details, don't need to blast
the details in the skip-message every time.
2018-02-12 13:24:48 +01:00
Justin M. Keyes
9bf9cc69c1 test/arglist_spec: update to Vim 8.0.0721 behavior 2018-02-11 19:03:28 +01:00
Justin M. Keyes
4b7f7be301 test: port Test_edit_08() to Lua test
Test_edit_08() depends on special-case handling in has_compl_option()
and redrawing() which are in Vim but are not wanted in Nvim. Using a Lua
test instead of depending on workarounds in the core to make the VimL
test work.
2018-02-11 19:03:27 +01:00
Justin M. Keyes
7d12597d29 vim-patch:8.0.0692: CTRL-G with 'incsearch' and ? goes in the wrong direction
Problem:    Using CTRL-G with 'incsearch' and ? goes in the wrong direction.
            (Ramel Eshed)
Solution:   Adjust search_start. (Christian Brabandt)

da5116da45
2018-02-11 15:27:56 +01:00
Justin M. Keyes
2cfc1b055b Merge #7939 "fix crash: 'spell' and long lines" 2018-02-11 13:04:39 +01:00
Justin M. Keyes
ed0d135247 Merge #7939 "fix crash: 'spell' and long lines"
closes #7937
2018-02-11 13:03:24 +01:00
Björn Linse
5d8da126d0 ui/tui: highlighting refactor
Make HlAttr contain highlighting state for both color modes (cterm and rgb).
This allows us to implement termguicolors completely in the TUI.

Simplify some logic duplicated between ui.c and screen.c. Also avoid
some superfluous highlighting reset events.
2018-02-11 10:29:32 +01:00
Jan Edmund Lazo
c03a847884 win: enable backtick_expansion and shell output tests 2018-02-10 22:28:12 +01:00
Björn Linse
f75c4b39ec shell: handle split-up UTF-8 sequences 2018-02-10 22:28:12 +01:00
Björn Linse
01cdeff626 tests: integrate ex_cmds/bang_filter_spec into ui/output_spec
they test the same thing. Filtering is tested elsewhere.
2018-02-10 22:28:12 +01:00
Björn Linse
60ce7d9e0a shell: support bell 2018-02-10 22:28:12 +01:00
Justin M. Keyes
a265334406 defaults: sidescroll=1
ref #6289
2018-02-09 02:15:25 +01:00
Michael Brailsford
a6136e8b0b screen.c: resolve neovim issue #7937 2018-02-07 13:46:37 -06:00
Justin M. Keyes
352a51e831 test: :! print binary data, control chars
closes #5442
closes #4142
ref #6618
ref #4376
ref #7844
ref #2958
ref #4338
2018-02-07 09:25:51 +01:00
Justin M. Keyes
d73dd1588c :terminal Enter/Leave should not increment jumplist
The old behavior is probably not justified, for the usual reason:
terminal buffers may have interactive processes, so cursor placement is
arbitrary, therefore tracking it in the jumplist is useless (or worse).

N.B.: per the docstring for `checkpcmark()` it looks like we were
calling `checkpcmark()` and `setpcmark()` in the wrong order.

closes #3723
2018-02-07 00:01:58 +01:00
Björn Linse
6744f48d88 tests: cleanup bufhl test 2018-02-06 20:16:38 +01:00
Björn Linse
4e7d85e635 shell: update execute('!cmd') test to new behavior
And similarly nvim_command_output test
2018-02-06 20:16:38 +01:00
Björn Linse
9af14506e5 shell: add test for binary and multibyte output
Also update existing tests for new (vim-compatible) newline behavior
2018-02-06 10:23:26 +01:00
James McCoy
de10ea55f3
lint 2018-02-03 22:19:08 -05:00
ZyX
2316a38dd1
tests: Make format_string('%q', ...) output more stable
It appears to be different on lua and luajit.
2018-02-02 07:28:56 -05:00
ZyX
a2dfeb8a16
functests: Improve error reporting in _check_parsing function
May be needed for unit tests as well though.
2018-02-02 07:28:56 -05:00
James McCoy
e243dbdc32
test: man_spec: Fix use of nested [[ quoting
Lua (not LuaJIT) complains about the "^[[" strings inside the expect,
since it sees them as nested quotes.  Change the quoting to [=[ ]=] to
avoid the issue.
2018-02-02 07:28:56 -05:00
Justin M. Keyes
709a87d194 Merge #7463 'incsearch + hlsearch highlight all' 2018-02-01 23:25:55 +01:00
Justin M. Keyes
f8010ea3ec
test: robust cleanup, unique filenames #7950 (#7950)
Use unique filenames to avoid test conflicts.
Use read_file() instead of io.popen(), to ensures the file is closed.
Use helpers.rmdir(), it is far more robust than lfs.

closes #7911
2018-02-01 03:12:37 +01:00
Justin M. Keyes
648fed975e os_system(): do not set up input stream for empty string #7951
Test failure:
test/functional/eval/system_spec.lua: "works with an empty string"
E5677: Error writing input to shell-command: EPIPE

ref https://github.com/neovim/neovim/pull/6558#issuecomment-361061035
ref #6554
2018-02-01 02:28:54 +01:00
KunMing Xie
649123d07c vim-patch:8.0.0358,8.0.0359 (#7832)
vim-patch:8.0.0358: invalid memory access in C-indent code
Problem:    Invalid memory access in C-indent code.
Solution:   Don't go over end of empty line. (Dominique Pelle, closes vim/vim#1492)
60629d6425

vim-patch:8.0.0359: 'number' and 'relativenumber' are not properly tested
Problem:    'number' and 'relativenumber' are not properly tested.
Solution:   Add tests, change old style to new style tests. (Ozaki Kiichi,
            closes vim/vim#1447)
dc9a081712
2018-01-30 21:21:29 +01:00
Mahmoud Al-Qudsi
5d2dd2ebe2 win: has("wsl") on Windows Subsystem for Linux #7330
Per CMAKE docs, CMAKE_HOST_SYSTEM_VERSION is the result of `uname -r`:
https://cmake.org/cmake/help/v3.4/variable/CMAKE_HOST_SYSTEM_VERSION.html?highlight=uname

    A numeric version string for the system. On systems that support
    uname, this variable is set to the output of uname -r. On other
    systems this is set to major-minor version numbers.

On Windows it is something like "6.1", so it won't match ".*-Microsoft".

Closes #7329
2018-01-30 21:12:49 +01:00
KunMing Xie
2a1a624878 vim-patch:8.0.0443: terminal width is set to 80 in test3 (#7933)
Problem:    Terminal width is set to 80 in test3.
Solution:   Instead of setting 'columns' set 'wrapmargin' depending on
            'columns.

38a3d6c960
2018-01-30 20:15:05 +01:00
Justin M. Keyes
397ff2c35b
Merge #5822 'mouse.c: Fix mouse click on multibyte + concealed' 2018-01-29 23:50:43 +01:00
Jan Edmund Lazo
41b3c7850f test: use helpers.pathroot() to avoid a syscall 2018-01-29 00:05:35 -05:00
Tommy Allen
1813c53e8d Updated tests 2018-01-28 23:47:11 -05:00
Jan Edmund Lazo
0578087e5e test: osx: try resolve($TMPDIR) 2018-01-28 13:58:56 -05:00
Jan Edmund Lazo
5c09f37d4a test: fix failed tests with $TMPDIR in QuickBuild 2018-01-28 13:58:56 -05:00
Jan Edmund Lazo
7ac21332cf Revert "test: fix failed test cases with tmpdir = $TMPDIR"
This reverts commit f7fe3012204169f22412194a78f196ffc72bb8c3.

Fails on QuickBuild because it uses a non-local path.
Need a environment-agnostic solution
2018-01-28 13:58:56 -05:00
Jan Edmund Lazo
28236867a0 test: fix failed test cases with tmpdir = $TMPDIR 2018-01-28 13:58:55 -05:00
Jan Edmund Lazo
c08c09add7 test: try $TMPDIR for temporary directory 2018-01-28 13:58:55 -05:00
Jan Edmund Lazo
5a39d2d00e test: fnamemodify with :8 filename modifier 2018-01-28 13:58:54 -05:00
Jan Edmund Lazo
984a93df96 win: enable legacy/fnamemodify_spec.lua 2018-01-28 13:58:54 -05:00
Jan Edmund Lazo
eb59dd6547 fixup: get network drive only, not entire path 2018-01-28 13:58:54 -05:00
Jan Edmund Lazo
534abe4aaf test: win: get current network drive via io.popen 2018-01-28 13:58:53 -05:00
Jan Edmund Lazo
a619c3fcf9 test: win: add tests for shellslash 2018-01-28 13:58:51 -05:00
Justin M. Keyes
afbdafffc2 test: fnamemodify() 2018-01-28 13:58:51 -05:00
George Zhao
499c9a1553 test/win: fix some environment assumptions #7912
fix #7909
fix #7910
2018-01-28 19:10:18 +01:00
Justin M. Keyes
300d3651e2
Merge #7919 from hardenedapple/langremap-after-map 2018-01-27 16:26:14 +01:00
Matthew Malcomson
f2ea15f364 Add some tests for 'langmap' 2018-01-27 11:20:10 +00:00
Ömer Sinan Ağacan
9bc1410ee1 vim-patch:8.0.1304: CTRL-G/CTRL-T don't work with incsearch and empty pattern
Problem:    CTRL-G/CTRL-T don't work with incsearch and empty pattern.
Solution:   Use the last search pattern. (Christian Brabandt, closes vim/vim#2292)

d048009717
2018-01-26 18:39:20 +03:00
Ömer Sinan Ağacan
997fc8b133 Add tests 2018-01-26 18:39:20 +03:00
Ömer Sinan Ağacan
41394d8236 vim-patch:8.0.1238
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
2018-01-26 18:39:20 +03:00
James McCoy
3ff92ba1ee
eval: save_tv_as_string: Correctly handle an empty string
When tv_get_string_chk returns a non-NULL value, we have a valid string.
Propagating an error state (*len = -1, NULL return) for an empty string
is invalid.

Closes #6554
2018-01-23 17:56:50 -05:00
Justin M. Keyes
15119f943a test: system(): fix test
For the test to be valid it should actually send input.

ref #3529
ref #5241
2018-01-23 21:33:44 +01:00
Justin M. Keyes
7dd97eb597
test/inccommand_spec: test the test (#7897) 2018-01-23 00:53:22 +01:00
Justin M. Keyes
eb4aab7173 ui: forward 'linespace' option #7883
ref #7520
2018-01-21 09:39:12 +01:00
Justin M. Keyes
0daaa49586 Merge #7863 'mingw64: fix gcc warnings' 2018-01-20 17:18:32 +01:00
Justin M. Keyes
ee84da358c
Merge #7878 from justinmk/keymap-leak 2018-01-20 16:33:43 +01:00
ckelsel
b00fd49640 vim-patch:8.0.0423: changing 'cinoptions' does not always work
Problem:    The effect of adding "vim/vim#" to 'cinoptions' is not always removed.
            (David Briscoe)
Solution:   Reset b_ind_hash_comment. (Christian Brabandt, closes vim/vim#1475)

6b64394f34
2018-01-20 15:48:23 +08:00
Marco Hinz
72a7a884b4
tests: :checkhealth completion 2018-01-18 22:47:37 +01:00
George Zhao
15334dcd89 Fix warning unused static function 2018-01-18 21:30:05 +08:00
George Zhao
12acf0f7a7 Fix warning when assing size_t type value to uv_buf_t.len, convert type to ULONG on Windows. 2018-01-18 21:30:04 +08:00
lePerdu
bc17ad31dc os/input.c: parse keycodes in non-string context #7411
cb02137dfa had two mistakes, of the same nature: trans_special() must
be invoked with in_string=false unless the parsing context is a VimL
string. replace_termcodes() and input_enqueue() are low-level
mechanisms where VimL strings do not exist.

keymap.c: adjust double-quote case to satisfy keymap_spec.lua

closes #7410
2018-01-18 01:37:51 +01:00
Justin M. Keyes
1be315de37 tui: final_column_wrap(): fix row calculation
closes #7572
closes #7579
closes #7628

ASAN report:

    ==9500==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6040000024c0 at pc 0x00000187d2ca bp 0x7fc3c6e58d10 sp 0x7fc3c6e58d08
    READ of size 8 at 0x6040000024c0 thread T1
        0 0x187d2c9 in ugrid_put /home/vagrant/neovim/build/../src/nvim/ugrid.c:107:17
        1 0x1850adf in tui_put /home/vagrant/neovim/build/../src/nvim/tui/tui.c:1012:10
        2 0x18a6ce6 in ui_bridge_put_event /home/vagrant/neovim/build/src/nvim/auto/ui_events_bridge.generated.h:154:3
        3 0xa4dcda in multiqueue_process_events /home/vagrant/neovim/build/../src/nvim/event/multiqueue.c:150:7
        4 0xa478bf in loop_poll_events /home/vagrant/neovim/build/../src/nvim/event/loop.c:63:3
        5 0x185451c in tui_main /home/vagrant/neovim/build/../src/nvim/tui/tui.c:362:12
        6 0x18a3080 in ui_thread_run /home/vagrant/neovim/build/../src/nvim/ui_bridge.c:106:3
        7 0x7fc3caaac6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)
        8 0x7fc3c9ca33dc in clone /build/glibc-bfm8X4/glibc-2.23/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:109

    0x6040000024c0 is located 0 bytes to the right of 48-byte region [0x604000002490,0x6040000024c0)
    allocated by thread T1 here:
        0 0x50e048 in malloc (/home/vagrant/neovim/build/bin/nvim+0x50e048)
        1 0xf7ab71 in try_malloc /home/vagrant/neovim/build/../src/nvim/memory.c:87:15
        2 0xf7ad99 in xmalloc /home/vagrant/neovim/build/../src/nvim/memory.c:121:15
        3 0x187937b in ugrid_resize /home/vagrant/neovim/build/../src/nvim/ugrid.c:32:17
        4 0x184be58 in tui_resize /home/vagrant/neovim/build/../src/nvim/tui/tui.c:770:3
        5 0x18a3dc8 in ui_bridge_resize_event /home/vagrant/neovim/build/src/nvim/auto/ui_events_bridge.generated.h:4:3
        6 0xa4dcda in multiqueue_process_events /home/vagrant/neovim/build/../src/nvim/event/multiqueue.c:150:7
        7 0xa478bf in loop_poll_events /home/vagrant/neovim/build/../src/nvim/event/loop.c:63:3
        8 0x185451c in tui_main /home/vagrant/neovim/build/../src/nvim/tui/tui.c:362:12
        9 0x18a3080 in ui_thread_run /home/vagrant/neovim/build/../src/nvim/ui_bridge.c:106:3
        10 0x7fc3caaac6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)

    Thread T1 created by T0 here:
        0 0x4655ed in __interceptor_pthread_create (/home/vagrant/neovim/build/bin/nvim+0x4655ed)
        1 0x1ad87b0 in uv_thread_create /home/vagrant/neovim/.deps/build/src/libuv/src/unix/thread.c:75
        2 0x184b9aa in tui_start /home/vagrant/neovim/build/../src/nvim/tui/tui.c:159:10
        3 0x188dd4c in ui_builtin_start /home/vagrant/neovim/build/../src/nvim/ui.c:125:3
        4 0xe6d399 in main /home/vagrant/neovim/build/../src/nvim/main.c:457:5
        5 0x7fc3c9bbc82f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291
2018-01-16 09:37:55 +01:00
Justin M. Keyes
60d6a8b13d Merge #7860 'fix get_buffer_lines' 2018-01-16 08:21:25 +01:00
James McCoy
514a51ef3e
get_buffer_lines: Return a string, when requested, on invalid input
Closes #7859
2018-01-15 22:55:15 -05:00
Justin M. Keyes
f8f7f9d5f5 vim-patch:8.0.0151,3,4 #7389
vim-patch:8.0.0151
Problem:    To pass buffer content to system() and systemlist() one has to
            first create a string or list.
Solution:   Allow passing a buffer number. (LemonBoy,
            closes vim/vim#1240)
12c4492dd3

vim-patch:8.0.0153
Problem:    system() test fails on MS-Windows.
Solution:   Deal when extra space and CR.
9d9c356517

vim-patch:8.0.0154
Problem:    system() test fails on OS/X.
Solution:   Deal with leading spaces.
31f19ce0a0
2018-01-15 23:50:40 +01:00
ZyX
9ea1752d60 *: Provide list length when allocating lists 2018-01-14 01:33:16 +03:00
Justin M. Keyes
5055d4a755 api: nvim_command_output: direct impl 2018-01-10 23:58:56 +01:00
Justin M. Keyes
c095f83116 api: change nvim_command_output behavior
Implement nvim_command_output with `execute({cmd},"silent")`.

Behavior changes:
- does not provoke any hit-enter prompt
- no longer prepends a newline char
- does not capture some noise (like the "[New File]" message, see the
  change to tabnewentered_spec.lua)

Technically ("bug-for-bug") this a breaking change.  But the previous
behavior of nvim_command_output meant that it probably wasn't used for
anything outside of tests.

Also remove the undocumented `v:command_output` variable which was
a hack introduced only for the purposes of nvim_command_output.

closes #7726
2018-01-10 23:45:44 +01:00
Justin M. Keyes
59888b68ab Merge #7623 'man.vim: highlight bold, underlined text' 2018-01-09 10:10:22 +01:00
Justin M. Keyes
8c2cb81d7e
test: set_shell_powershell(): update flags (#7819) 2018-01-07 16:20:37 +01:00
Justin M. Keyes
4fedad6c5b Merge #7753 'win: enable more functional tests' 2018-01-06 17:52:14 +01:00
Jan Edmund Lazo
ab1e11e44f test: win: yes is unavailable on Windows 2018-01-06 17:50:49 +01:00
Jan Edmund Lazo
d4485f7cc0 win: test: check non-shell system() 2018-01-06 17:49:42 +01:00
Jan Edmund Lazo
8d58012786 test: use unix fileformat to test NULs on systemlist 2018-01-06 17:49:42 +01:00
Jan Edmund Lazo
7311fb7cad win: enable more functional tests
- plugin/shada_spec.lua: Use \r\n as Windows EOL for tests on
  BufWriteCmd, FileWriteCmd, FileAppendCmd. Alternative is 'set
  fileformat=unix'.
2018-01-06 17:47:00 +01:00
Jan Edmund Lazo
e9b5616eaf win: enable tests in ex_terminal_spec 2018-01-06 17:46:49 +01:00
Justin M. Keyes
b616ef9b22 tests: stderr output contains cp noise
closes #7811
2018-01-05 18:18:26 +01:00
Justin M. Keyes
7c4bb23ff3 defaults: do :filetype stuff unless explicitly "off"
Until now, the default `:filetype ...` setup was skipped if the user
config touched `:filetype` in any way (including implicitly via `:syntax
on`).  No one needs that, and it's very confusing.

Instead, proceed with `:filetype ... on` unless the user explicitly
called `:filetype ... off`.

closes #7765
2018-01-04 10:32:09 +01:00
Jan Edmund Lazo
d55881d278 test: enable K_spec tests in Windows 2018-01-03 00:12:28 -05:00
Justin M. Keyes
9ad557fb2d
Merge pull request #7762 from ZyX-I/remove-some-listitems
Remove some tv_list_item_…() functions
2017-12-31 01:11:50 +01:00
Daniel Hahler
46f432074e tests: termclose_spec: fix flaky SIGTERM test #7787
Followup to https://github.com/neovim/neovim/pull/7217.
Build failure: https://travis-ci.org/neovim/neovim/jobs/322930672#L2958.
2017-12-30 22:49:50 +01:00
Justin M. Keyes
9dc90fcde1 Merge #7782 'Fix TabClose autocommand via close_windows' 2017-12-30 14:12:25 +01:00
Daniel Hahler
e84e1b68c1 Move applying of TabClosed to win_close_othertab 2017-12-29 20:38:17 +01:00
Gabriel Holodak
eb44519b5d Address PR comments 2017-12-27 23:28:04 -05:00
Gabriel Holodak
134c0f0bdb Add functional tests for man highlighting 2017-12-27 23:27:14 -05:00
ZyX
bc52ec6110 *: Fix linter errors 2017-12-24 23:09:26 +03:00
ZyX
7997147245 eval: Replace some tv_list_item_remove() calls
There is nothing wrong with them, just it is generally better to remove
a range then to remove items individually.
2017-12-24 17:52:24 +03:00
ZyX
2923e8533d unittests: Do gc after reporting error, not before
Reason: test may contain cleanup at the endwhich is needed for GC to work 
properly, but is not done if test fails. With collectgarbage() in former 
position it would crash when collecting garbage.
2017-12-24 17:42:23 +03:00
ZyX
32689aa5be unittests: Remove start of trace, not end 2017-12-24 17:13:49 +03:00
ZyX
67fa9e5237 eval: Rename tv_list_remove_items() to tv_list_drop_items()
tv_list_remove_items() may cause confusion with tv_list_item_remove()
2017-12-24 16:38:30 +03:00
ZyX
ac55558c97 eval/typval: Make tv_list_item_remove return pointer to the next item 2017-12-24 14:09:36 +03:00
ZyX
608c3d7baf eval/typval: Remove tv_list_item_free() as it is unused 2017-12-24 14:09:36 +03:00
ZyX
6bf3dc77c4 eval/typval: Make tv_list_item_alloc static
Better write this bit in lua then make reviewers or clint filter out 
tv_list_item_alloc().
2017-12-24 14:09:36 +03:00
ZyX
0c533a488f *: Remove most calls to tv_list_item_alloc
Still left calls in eval/typval.c and test/unit/eval/helpers.lua. Latter is the 
only reason why function did not receive `static` modifier.
2017-12-24 14:09:35 +03:00
ZyX
6b45dbca04 mark: Make sure that jumplist item will not have zero lnum
Fixes #7169
2017-12-24 00:32:43 +03:00
Justin M. Keyes
dee78a4095
Merge #7708 from ZyX-I/hide-container-impl 2017-12-23 18:17:01 +01:00
Björn Linse
308dd53783 channel: check for existance before trying to set key
This avoids an error message in async context, where it is not safe.
2017-12-23 14:02:00 +01:00
ZyX
c9ab209f9e Merge branch 'master' into hide-container-impl 2017-12-23 15:27:42 +03:00
Justin M. Keyes
103ff26c0a provider/nodejs: check version in Detect() 2017-12-17 16:09:18 +01:00
Jan Edmund Lazo
5b692124cc test: remove inspect test; set NODE_PATH in nodejs_spec.lua
provider#node#can_inspect will fail on some systems because it is common
to have old node versions in OS (any Linux OS that has LTS releases)
and CI (Travis, Appveyor).

NODE_PATH can be trivially set with VimL.
Build scripts don't have to set it for the nodejs tests to work.
NODE_PATH is optional to begin with and is used only as a workaround
for the neovim node.js host.
2017-12-17 16:09:18 +01:00
Jan Edmund Lazo
a1adfdc7d5 ci: nodejs client acceptance-test #7706
ci: install nodejs 8 in Appveyor, Travis

provider: check node version for debug support
Resolve https://github.com/neovim/neovim/pull/7577#issuecomment-350590592 for Unix.

provider: test if nodejs in ci supports --inspect-brk

nodejs host for neovim requires nodejs 6+ to work properly.
nodejs 6.12+ or 7.6+ is required for debug support via `node --inspect-brk`.

provider: run cli.js of nodejs host directly

npm shims are useless because the user cannot set node to debug mode via
--inspect-brk. This is problematic on Windows which use batchfiles and
shell scripts to compensate for not supporting shebang.

The patch uses `npm root -g` to get the absolute path of the global npm
modules. If that fails, then the user did not install neovim npm package
globally. Use that absolute path to find `neovim/bin/cli.js`, which is
what the npm shim actually runs with node. glob() is for a simple file
check in case bin/ is removed because the npm shims are ignored now.
2017-12-17 16:09:18 +01:00
ZyX
023631463c functests: Fix linter error 2017-12-16 16:14:53 +03:00
ZyX
7f3b9a4acc Merge branch 'master' into hide-container-impl 2017-12-16 14:27:41 +03:00
ZyX
fb07391ce4 window: Fix matchaddpos() and enhance error reporting 2017-12-15 11:38:34 +03:00
ZyX
c8a5d6181b *: Fix some problems found during review
Still missing: problems in window.c, it should be possible to construct a test
for them.
2017-12-15 02:39:46 +03:00
Björn Linse
34057045be
ui: forward relevant option updates to UIs (#7520)
also make termguicolors mutable after startup
2017-12-12 18:23:19 +01:00
ZyX
1f9dd689b9 Merge branch 'master' into hide-container-impl 2017-12-12 00:44:25 +03:00
ZyX
1a961b5750 eval: Fix add() 2017-12-11 10:34:58 +03:00
ZyX
ceb45a0885 *: Fix test failures 2017-12-11 01:43:36 +03:00
ZyX
622d355ab4 functests: Add some more NULL tests 2017-12-10 23:16:00 +03:00
ZyX
d11884db49 eval: Fix uniq() crash in legacy test 055 2017-12-10 23:02:19 +03:00
ZyX
0b03ac2cb2 functests: Mark islocked("v:_null_list") behaviour correct
It is the same for other VAR_FIXED lists.
2017-12-10 22:34:32 +03:00
ZyX
83f77c80c0 quickfix: Fix :cexpr and :lexpr 2017-12-10 22:33:05 +03:00
ZyX
5008205a3e eval: Fix setmatches(), setqflist() and setloclist() 2017-12-10 22:28:18 +03:00
ZyX
f572bd7e4e eval,functests: Fix tests and complete() and setline() behaviour 2017-12-10 22:24:11 +03:00
ZyX
ac4bbf55f6 *: Hide list implementation in other files as well 2017-12-10 22:04:43 +03:00
Justin M. Keyes
ad9c2d3cb9 doc
closes #7622
2017-12-10 17:13:22 +01:00
glacambre
abe38f7d26 window.c: do BufEnter in correct window after closing help #7431
closes #7429

Problem: after a help window was closed, a window was selected and its
autocommands triggered. After that, restore_snapshot was called and the
focused window changed, confusing the user.

Solution: Add function get_snapshot_focus() that returns the window that
holds the cursor in a snapshot. Use this function in win_close to make
sure the right window is selected before any autocommand is triggered.
2017-12-10 14:55:59 +01:00
ZyX
5c1ddb5078 eval: Fix writefile() 2017-12-10 04:00:54 +03:00
ZyX
21745d72b8 eval: Fix inputlist() 2017-12-10 04:00:54 +03:00
ZyX
274f32d42e *: Start hiding list implementation
Most of files, except for eval.c and eval/* were only processed by perl.
2017-12-10 04:00:52 +03:00
Justin M. Keyes
3cc7ebf810 Merge #7234 'built-in expression parser' 2017-12-09 18:47:34 +01:00
Björn Linse
ba7d6a9e6b ui: fix glitch with both ext_cmdline and cmd_wildmenu 2017-12-06 09:41:51 +01:00
Björn Linse
9714b9f590 tests: cleanup ui/cmdline_spec.lua 2017-12-05 13:32:02 +01:00
Justin M. Keyes
aec81f44d1
Merge #7477 from FlorianGit/empty-lists-dicts-strings 2017-12-05 03:33:01 +01:00
Justin M. Keyes
2d4abc1cae tui: flush -V3 ('verbose' >= 3) info ASAP 2017-12-05 01:46:41 +01:00
Justin M. Keyes
837100fcb1 test/tui: -V3log logs terminfo values 2017-12-05 01:46:41 +01:00
Justin M. Keyes
5f288220f9 test: write_file(): support append-mode 2017-12-05 01:46:41 +01:00
Justin M. Keyes
7f386b175c test: retry(): fix time calculation
libuv caches the results of uv.now() until the next loop tick. If a test
does not spin the libuv event loop, retry() enters an infinite cycle.
2017-12-05 01:46:40 +01:00
Justin M. Keyes
175174597d test: macOS 10.13: unibilium cannot find "xterm" terminfo
On some macOS versions we can't find the terminfo for whatever reason,
so just skip the test if it fails.
2017-12-05 01:46:40 +01:00
Justin M. Keyes
a11751eae8 test: tui_spec: narrower scope for timeout tweaks 2017-12-05 01:46:40 +01:00
ZyX
fbdc3ac4ef tests: Fix linter errors 2017-12-03 20:22:09 +03:00
FlorianGit
d763d2fe7a Viml: Make filter and map handle null list correct
filter('v:_null_list, 'v:val') should return v:_null_list and a similar
statement should hold for map.

Changes after review

 * Test inserted in legacy test suite has been removed by reverting the commit
adding it.
 * Change the fix to tv_copy the argument before returning.
 * Readd the two tests on crashes, and modified their expected return value.
 * Move the test from 'incorrect behaviour' section to 'correct behaviour section'
 * Add analogous tests for v:_null_dict

Always copy list or dictionary to return variable

If the type of input is correct (i.e. either a list or a dictionary), this
should also be returned.
2017-12-03 17:03:31 +01:00
ZyX
c49e22d396 Merge branch 'master' into s-dash-stdin 2017-12-03 16:49:30 +03:00
ZyX
5ab0f988ca *: Replace all occurrences of NVim with Nvim 2017-11-30 11:53:25 +03:00
ZyX
0b4054e043 unittests: Reduce memory used by vim_str2nr test 2017-11-30 11:48:23 +03:00
ZyX
b588ccddd7 Merge branch 'master' into expression-parser 2017-11-30 02:02:55 +03:00
ZyX
de45ec0146 keymap: Do not use vim_isIDc in keymap.c
Note: there are three changes to ascii_isident. Reverting first two (in 
find_special_key and first in get_special_key_code) normally fails the new test 
with empty &isident, but reverting the third does not. Hence adding `>` to 
&isident.

Ref vim/vim#2389.
2017-11-30 02:01:49 +03:00
James McCoy
59f4bd435c unittest: Ignore _Float128 types in ffi
When building with certain GCC versions, a _Float128 type is present
when setting up the ffi for unit tests.

    ./test/unit/helpers.lua:256: declaration specifier expected near '_Float128' at line 396
    /usr/bin/luajit: /usr/share/lua/5.1/busted/runner.lua:99: attempt to concatenate local 'message' (a table value)
    stack traceback:
    	/usr/share/lua/5.1/busted/runner.lua:99: in function 'fn'
    	/usr/share/lua/5.1/mediator.lua:103: in function 'publish'
    	/usr/share/lua/5.1/busted/modules/helper_loader.lua:21: in function 'helperLoader'
    	/usr/share/lua/5.1/busted/runner.lua:147: in function </usr/share/lua/5.1/busted/runner.lua:11>
    	/usr/bin/busted:3: in main chunk
    	[C]: at 0x004044a0

    CMake Error at /<<PKGBUILDDIR>>/cmake/RunTests.cmake:53 (message):
      Running unit tests failed with error: 1.

Since this is being pulled in by a dependency, not directly used by
nvim, just ignore the type.

Closes #7423
2017-11-29 10:07:12 -05:00
Justin M. Keyes
d109f5645b
Merge #7640 'term' option 2017-11-27 22:07:23 +01:00
Björn Linse
e3c4c8a90e tests: mark flaky socket test pending for now 2017-11-27 11:43:24 +01:00
Justin M. Keyes
6cf186edb5 lint 2017-11-27 09:45:32 +01:00
Justin M. Keyes
c8b40930c0 test: tui_spec.lua: use robust settings 2017-11-27 09:45:32 +01:00
Justin M. Keyes
944e3c0619 tui: expose terminal type in 'term' option
Since "builtin" terminfo definitions were implemented (7cbf52db1b),
the decisions made by tui.c and terminfo.c are more relevant. Exposing
that decision in the 'term' option helps with troubleshooting.

Also: remove code that allowed setting t_Co. `:set t_Co=…` has never
worked; the highlight_spec test asserting that nvim_set_option('t_Co')
_does_ work makes no sense, and should not have worked.
2017-11-27 09:45:32 +01:00
ZyX
36a4f3a259 viml/parser/expressions: Make sure that listed nodes may be present
With the new test leaving `assert(false);` for any of the cases makes tests 
crash.
2017-11-26 16:57:42 +03:00
ZyX
cddf84c398 functests: Add some more tests 2017-11-26 16:45:29 +03:00
ZyX
17077b6813 viml/parser/expressions: Make $ENV not depend on &isident 2017-11-26 16:08:53 +03:00
ZyX
b9c7813058 Merge branch 'master' into expression-parser 2017-11-26 15:54:03 +03:00
Björn Linse
207b7ca4bc
Merge pull request #6844 from bfredl/channel
channels: support buffered output and bytes sockets/stdio
2017-11-26 10:18:01 +01:00
Björn Linse
91b856ccce channels: tests 2017-11-26 09:17:04 +01:00
nate
ebed8c6a2e test: :highlight validation errors
add test when highlight group doesn't exist.
add test when an invalid color name is used for `cterm`.
2017-11-25 23:22:23 +01:00