Commit Graph

8399 Commits

Author SHA1 Message Date
ZyX
276ee1f7fb eval: Add comment regarding why special values are needed 2017-04-14 23:58:46 +03:00
ZyX
b2942d1e72 eval: Change the point at which arg_errmsg and its length are changed
Ref #6437
2017-04-14 23:58:46 +03:00
Justin M. Keyes
58d2ce9bdb test: check_cores(): Escape $TMPDIR path. (#6520)
Lua string:match() considers hyphen to be a special char, we want the
path to be a literal match. Also remove "./", etc.

References #6483
2017-04-14 20:34:54 +02:00
Justin M. Keyes
45b5ebea9d perf: tv_clear(): Cache gettext() result. (#6519)
Closes #6437
2017-04-14 17:41:59 +02:00
Justin M. Keyes
dd391bfca1 Merge #6497 from justinmk/win-quot
win: system('...'): special-case cmd.exe
2017-04-12 03:21:21 +02:00
Justin M. Keyes
7c4e5dfd27 win: os_shell_is_cmdexe() + tests 2017-04-12 02:28:43 +02:00
Rui Abreu Ferreira
d31d177a0c win: default shellxescape, shellxquote to empty
Calling cmd.exe in Windows follows a very different pattern from Vim.
The primary difference is that Vim does a nested call to cmd.exe, e.g.
the following call in Vim

    system('echo a 2>&1')

spawns the following processes

    "C:\Program Files (x86)\Vim\vim80\vimrun" -s C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
        ^>C:\Users\dummy\AppData\Local\Temp\VIoC169.tmp 2^>^&1)
    C:\Windows\system32\cmd.exe /c C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
        ^>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2^>^&1)
    C:\Windows\system32\cmd.exe  /c (echo a 2>&1
        >C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2>&1)

The escaping with ^ is needed because cmd.exe calls itself and needs to
preserve the special metacharacters for the last call. However in nvim
no nested call is made, system('') spawns a single cmd.exe process.
Setting shellxescape to "" disables escaping with ^.

The previous default for shellxquote=( wrapped any command in
parenthesis, in Vim this is more meaningful due to the use of tempfiles
to store the output and redirection (also see &shellquote). There is
a slight benefit in having the default be empty because some expressions
that run in console will not run within parens e.g. due to unbalanced
double quotes

    system('echo "a b')
2017-04-12 02:10:34 +02:00
Rui Abreu Ferreira
f3cc843755 win: libuv_process_spawn(): special-case cmd.exe
Disable CommandLineToArgvW-standard quoting for cmd.exe.

libuv assumes spawned processes follow the convention expected by
CommandLineToArgvW(). But cmd.exe is non-conformant, so for cmd.exe:
- With system([]), the caller has full control (and responsibility) to
  quote arguments correctly.
- With system(''), shell* options are used.

libuv quoting is disabled if argv[0] is:
- cmd.exe
- cmd
- $COMSPEC resolving to a path with filename cmd.exe

Closes #6329
References #6387
2017-04-12 02:10:34 +02:00
Rui Abreu Ferreira
799443c994 win/test: Enable more system() tests 2017-04-12 02:10:33 +02:00
Justin M. Keyes
f7611d74e7 win: vim_strsave_shellescape: Handle 'shellslash'.
From Vim, misc2.c:vim_strsave_shellescape
2017-04-12 02:10:33 +02:00
Justin M. Keyes
d6e5f94ae9 win: defaults: 'shellredir', 'shellxquote', 'shellxescape' 2017-04-12 01:35:49 +02:00
Felipe Oliveira Carvalho
2d72d85b23 refactor: pos_T macros to functions (#6496) 2017-04-11 22:44:48 +02:00
Björn Linse
1b94852ccb Merge pull request #6495 from bfredl/localefix
run Turkish locale tests on travis and make the tests more reliable
2017-04-11 12:38:58 +02:00
Björn Linse
69775f603f ci: install Turkish locale and make locale tests more reliable 2017-04-11 10:24:19 +02:00
Justin M. Keyes
337299c808 Merge #6490 from justinmk/test
Closes #6487
2017-04-11 03:14:10 +02:00
Justin M. Keyes
de378477cc ci/appveyor: fix cache pattern 2017-04-11 02:37:39 +02:00
Justin M. Keyes
119f0ca854 test: helpers.execute() => helpers.feed_command() 2017-04-11 02:37:39 +02:00
Justin M. Keyes
dab3f86d09 win/test: Enable recover_spec.lua 2017-04-11 02:37:39 +02:00
erw7
4a63d9e5f8 win: mch_open_rw: specify S_IWRITE #6487
On Windows, `mch_open_rw` is not actually doing what it claims. This
manifests as "E301: Oops, lost the swap file !!!" when filename is
changed with :file {name}.

Steps to reproduce (covered by test/functional/ex_cmds/file_spec.lua):
    nvim -u NONE
    :edit test
    :file test2
    E301 Oops, lost the swap file!!!

From libuv/src/win/fs.c:
    void fs__open(uv_fs_t* req) {
      ...
      attributes |= FILE_ATTRIBUTE_NORMAL;
      if (flags & _O_CREAT) {
        if (!((req->fs.info.mode & ~current_umask) & _S_IWRITE)) {
          attributes |= FILE_ATTRIBUTE_READONLY;
        }
      }
2017-04-11 00:39:12 +02:00
Justin M. Keyes
2d29638744 test: :file {name} 2017-04-11 00:39:12 +02:00
Justin M. Keyes
6cbf290d56 test/rmdir(): fallback to Nvim delete()
Lua has too many pitfalls here:
- os.execute() requires shell-escaping
- os.execute() has breaking changes between Lua 5.1 and 5.2
- No native way in Lua to handle "readonly" etc. on Windows
2017-04-11 00:39:12 +02:00
Justin M. Keyes
0ce9618918 test/rmdir(): Remove readonly attr on Windows. 2017-04-10 22:59:30 +02:00
ZyX
22fb9d8d25 Merge branch 'master' into 1476-changes 2017-04-10 19:12:56 +03:00
Justin M. Keyes
9aface8c4d Merge #6489 from ZyX-I/own-output-handler 2017-04-10 15:53:40 +02:00
Justin M. Keyes
fec53f0bdf Merge #6479 from bfredl/tolower
remove vim_tolower/etc functions with broken locale-dependent behavior
2017-04-10 15:23:44 +02:00
ZyX
60ee50ce4b appveyor: Widen .deps cache dependency 2017-04-10 16:17:02 +03:00
ZyX
2a8055a8d9 ci: Make appveyor use new output handler as well 2017-04-10 15:11:41 +03:00
Justin M. Keyes
dd7f41e5a0 Merge #6488 from ZyX-I/coverity-fixes 2017-04-10 14:04:19 +02:00
ZyX
55292685d3 pvscheck: Add --recheck argument 2017-04-10 14:07:26 +03:00
ZyX
2b13c87fa2 pvscheck: Do not use --depth 2017-04-10 13:47:31 +03:00
ZyX
d7086f44f4 pvscheck: Do not trace help 2017-04-10 13:45:33 +03:00
ZyX
3bd11f2911 pvsscript: Use git clone and not git worktree 2017-04-10 13:42:31 +03:00
ZyX
59f0cbc282 pvscheck: Add help 2017-04-10 13:41:09 +03:00
ZyX
ebfcf2fa38 scripts: Create script which checks Neovim with PVS-studio 2017-04-10 13:24:31 +03:00
Björn Linse
c1cf033981 lint: fix clint errors around mb_tolower calls 2017-04-10 12:02:26 +02:00
Björn Linse
acc06b0b7b vim-patch:8.0.0552
Problem:    Toupper and tolower don't work properly for Turkish when 'casemap'
            is empty. (Bjorn Linse)
Solution:   Check the 'casemap' options when deciding how to upper/lower case.

3317d5ebbe

vim-patch:8.0.0553

Problem:    Toupper/tolower test with Turkish locale fails on Mac.
Solution:   Skip the test on Mac.

9f4de1f543

vim-patch:8.0.0554

Problem:    Toupper and tolower don't work properly for Turkish when 'casemap'
            contains "keepascii". (Bjorn Linse)
Solution:   When 'casemap' contains "keepascii" use ASCII toupper/tolower.

1cc482069a

vim-patch:8.0.0555

Problem:    Toupper/tolower test fails on OSX without Darwin.
Solution:   Skip that part of the test also for OSX. (Kazunobu Kuriyama)

d2381a2cad
2017-04-10 12:02:26 +02:00
Björn Linse
4c857dae11 vim-patch:8.0.0243
Problem:    When making a character lower case with tolower() changes the byte
            cound, it is not made lower case.
Solution:   Add strlow_save(). (Dominique Pelle, closes vim/vim#1406)

cc5b22b3bf

Join almost identical strup_save and strlow_save functions to one
Function.
2017-04-10 12:02:26 +02:00
Björn Linse
a3a06d0248 test: add tests for gu/gU behavior in Turkish locale 2017-04-10 12:02:25 +02:00
Björn Linse
db9ef6263e mbyte: replace vim_tolower with mb_tolower handling locale correctly 2017-04-10 12:01:40 +02:00
Nikolai Aleksandrovich Pavlov
3b88e37b83 Merge pull request #6492 from ZyX-I/fix-clint-incremental-build
cmake: Do not forget to actually create a touch file for errors.tar.gz
2017-04-10 11:26:33 +03:00
ZyX
6f5e87e4aa tests: Rename neovim output handler to nvim 2017-04-10 03:51:51 +03:00
ZyX
40dee97442 third-party: Update busted version 2017-04-10 03:51:50 +03:00
ZyX
accc7a0b6c tests: Skip dumping elapsed times when not available
Should provide some compatibility with old busted. And also removes duplicate 
parts from successString and skippedString, making them more like failureString 
and errorString which do not have times for technical reasons (busted for some 
reason did not yet compute duration before running the relevant handlers).
2017-04-10 03:51:50 +03:00
ZyX
1b66ed890b cmake: Do not forget to actually create a touch file for errors.tar.gz 2017-04-10 03:50:05 +03:00
ZyX
bc61058dd8 tests: Print description also at the end of the suite 2017-04-10 02:51:27 +03:00
ZyX
d909724d70 tests: Use our own output handler on travis
Reasoning:

1. gtest is better then something like utfTerminal, yet it is way too verbose.
2. gtest cannot be configured to show colors always.
3. Actually I am going to add a CMake target which will allow running tests 
   (especially, functional tests) in parallel, but this is not going to work 
   well with any of the default output handlers. Build in this case must be more 
   or less silent, yet debuggable. New handler does not support this in this 
   commit though.
2017-04-10 02:32:09 +03:00
Justin M. Keyes
d7fb7de70a Merge #6481 from ZyX-I/rename-execute
Rename execute() function to feed_command()
2017-04-09 22:51:59 +02:00
ZyX
ebe5051977 spellfile: Fix SAL sections reading 2017-04-09 23:46:38 +03:00
ZyX
fa7ace446e coverity/56795: Fix NULL dereference in :syn keyword non-printable
Bug was introduced 3 years earlier, in 13848aa: NULL keyword_copy was 
incorrectly treated as an indicator of OOM.
2017-04-09 23:38:05 +03:00
ZyX
eb3663eb10 spellfile: Fix clint errors 2017-04-09 22:39:23 +03:00