Commit Graph

2300 Commits

Author SHA1 Message Date
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