Commit Graph

10106 Commits

Author SHA1 Message Date
Justin M. Keyes
300d3651e2
Merge #7919 from hardenedapple/langremap-after-map 2018-01-27 16:26:14 +01:00
Matthew Malcomson
df4f9342b9 Make 'langnoremap' apply directly after a map
We were initially checking whether to apply 'langmap' translation based
on typebuf.tb_maplen.
This gets set to 0 on the last byte of a map when the del_typebuf()
function is called, which means that the option was not working for the
last character of a mapping.
For this reason, we switched to using KeyTyped to decide whether to
apply the transformation or not in commit 53da57d27.
Substituting one for the other isn't enough, because KeyTyped isn't set
until vgetorpeek() is returning.
This means 'langmap' translations are not applied when searching for
characters to map in the vgetorpeek() function if the *previous* key was
not typed.

We can't assert that both hold, as we would then *not* apply the
transformation when looking for a map starting with the first typed key
after a previously expanded map (as KeyTyped would be `false` from the
previously expanded map, and not yet reset).

Hence we assert that if we are looking for the mapping while in
vgetorpeek(), the map length should be zero, otherwise, KeyTyped must be
`true`.

This is implemented by checking for the variable `vgetc_busy`.
2018-01-27 11:44:15 +00:00
Matthew Malcomson
f2ea15f364 Add some tests for 'langmap' 2018-01-27 11:20:10 +00:00
Justin M. Keyes
0a56bd3330 build/macOS: remove -iframework line #7891
Linker error:

    [1/3] Linking C executable bin/nvim
    ld: warning: directory not found for option '-FCoreFoundation'

Only the -isysroot change is needed, see
https://github.com/neovim/neovim/pull/7891#discussion_r164036958
2018-01-26 11:42:07 +01:00
James McCoy
83880cced3
Merge pull request #6558 from jamessan/tv_as_string-fix
eval: save_tv_as_string: Correctly handle an empty string
2018-01-25 14:09:36 -05:00
KunMing Xie
8b1f7d8774 vim-patch:8.0.0431 (#7908)
vim-patch:8.0.0431: 'cinoptions' cannot set indent for extern block
Problem:    'cinoptions' cannot set indent for extern block.
Solution:   Add the "E" flag in 'cinoptions'. (Hirohito Higashi)
7720ba8599
2018-01-25 11:26:47 +01:00
George Zhao
a3daa8cb13 build: fix luacheck detection (avoids re-download on win32) (#7905) 2018-01-24 10:29:30 +01: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
James McCoy
6762c20af8
Merge pull request #7894 from jamessan/cmake-cmp0026-fix
cmake: Use generator expression to determine libnvim-test path
2018-01-23 08:41:04 -05:00
Justin M. Keyes
7dd97eb597
test/inccommand_spec: test the test (#7897) 2018-01-23 00:53:22 +01:00
Justin M. Keyes
3308b76339
Merge #7890 'vim-patch: various' 2018-01-22 23:13:54 +01:00
James McCoy
41a91af5cf cmake: Use generator expression to determine libnvim-test path
Prior to CMake 2.8.12, generator expressions could only be used in
custom commands so the path to libnvim-test in test/config/paths.lua was
set by inspecting the target's LOCATION property.  Post 2.8.12, the
file(GENERATE) command exists to handle this, but it can't interpolate
normal CMake variables.

In order to bridge the gap while < 2.8.12 is supported, use
configure_file() to create paths.lua.gen with the
$<TARGET_FILE:nvim-test> generator expression and then generate the
final paths.lua file.

Closes #7077
2018-01-22 14:16:31 -05:00
Justin M. Keyes
84d4e4a7ef
Merge #7891 'build: fix creating generated files on macOS' 2018-01-22 19:40:58 +01:00
Marco Hinz
59ac170340
Merge #7893 'man.vim: use correct offset in presence of modifier commands' 2018-01-22 17:31:36 +01:00
Marco Hinz
dbcdd29139
man.vim: use correct offset in presence of modifier commands
The argument expansion for :Man depends on the number of arguments given to it
starting at the command itself. But user completion functions always provide the
entire command-line which can include modifier commands like :tab, :vert, etc.
leading to a wrong number of arguments.

Prune all arguments up to :Man.

Fixes #7872.
2018-01-22 17:05:52 +01:00
John Szakmeister
17b21eae52 build: fix creating generated files on macOS
For some reason, using the clang executable inside of the Xcode default
toolchain the platform's sysroot include isn't present.  This was
debugged by adding "-###" on the command line for generating the header
for nvim/os/lang.c and is was evident the flag was missing.
2018-01-22 06:27:14 -05:00
Justin M. Keyes
b69fa866db
Merge #7888 'defaults: enable cscopeverbose' 2018-01-22 10:17:55 +01:00
Justin M. Keyes
872ee4259a vim-patch: NA
vim-patch:8.0.0674: cannot build with eval but without timers
vim-patch:8.0.0673: build failure without conceal feature
vim-patch:8.0.0668: nsis installer script does not work
vim-patch:8.0.0666: dead for loop
vim-patch:8.0.0665: warning for uninitialized variable
vim-patch:8.0.0664: mouse does not work in tmux
vim-patch:8.0.0661: recognizing urxvt mouse codes does not work well
vim-patch:8.0.0660: silent install on MS-Windows shows dialog
2018-01-21 18:42:45 +01:00
Justin M. Keyes
d6cbe6ca87 vim-patch:8.0.0667: more tests for :endfunc
[Only the test is merged; code was addressed by 60c025267265.]

Problem:    Memory access error when command follows :endfunction. (Nikolai
            Pavlov)
Solution:   Make memory handling in :function straightforward. (closes vim/vim#1793)
53564f7c1a
2018-01-21 18:42:45 +01:00
Justin M. Keyes
fb855feb52 vim-patch:8.0.0662: stray FIXME for fixed problem
Problem:    Stray FIXME for fixed problem.
Solution:   Remove the comment. (Dominique Pelle)

4670490673
2018-01-21 18:42:45 +01:00
Justin M. Keyes
154822933e vim-patch:8.0.0659: no test for conceal mode
Problem:    No test for conceal mode.
Solution:   Add a conceal mode test. (Dominique Pelle, closes vim/vim#1783)

4d785895d1
2018-01-21 18:42:45 +01:00
Justin M. Keyes
a5d33d5e90 vim-patch:8.0.0656: cannot use ! after some user commands
[Test passes, and the code change doesn't look applicable. So this only
includes the test.]

Problem:    Cannot use ! after some user commands.
Solution:   Properly check for existing command. (Higashi Higashi)
6f9a476b2f
2018-01-21 18:42:45 +01:00
Justin M. Keyes
a185ab70fd vim-patch:8.0.0655: not easy to make sure a function does not exist
Problem:    Not easy to make sure a function does not exist.
Solution:   Add ! as an optional argument to :delfunc.

d6abcd154c
2018-01-21 18:42:45 +01:00
Justin M. Keyes
52778d62fc vim-patch:8.0.0654: no warning for text after :endfunction
Problem:    Text found after :endfunction is silently ignored.
Solution:   Give a warning if 'verbose' is set.  When | or \n are used,
            execute the text as a command.
663bb23316

Note: the code part of this patch was addressed by 60c0252672.
2018-01-21 18:42:44 +01:00
Justin M. Keyes
2820860ba3
Merge #7885 'vim-patch: diff-related patches' 2018-01-21 13:33:04 +01:00
Justin M. Keyes
53749e1749 defaults: enable 'cscopeverbose', and deprecate it 2018-01-21 13:18:05 +01:00
Justin M. Keyes
e2eff5269f doc: if_cscop: cleanup 2018-01-21 12:41:35 +01:00
Justin M. Keyes
ab279c6fb8 vim-patch:8.0.0444: diffpatch fails when the file name has a quote
Problem:    Diffpatch fails when the file name has a quote.
Solution:   Escape the name properly. (zetzei)

a95ab32120
2018-01-21 12:21:48 +01:00
Justin M. Keyes
456cf72974 vim-patch:8.0.0442: patch shell command not well escaped
Problem:    Patch shell command uses double quotes around the argument, which
            allows for $HOME to be expanded. (Etienne)
Solution:   Use single quotes on Unix. (closes vim/vim#1543)

1ef73e33c9
2018-01-21 12:21:47 +01:00
Justin M. Keyes
ce09d4134b vim-patch:8.0.0433: beeps when running tests
Problem:    Quite a few beeps when running tests.
Solution:   Set 'belloff' for these tests. (Christian Brabandt)

c3c766ea8c
2018-01-21 12:21:47 +01:00
Justin M. Keyes
9c92eed86f vim-patch:8.0.0599: diff mode is insufficiently tested
Problem:    diff mode is insufficiently tested
Solution:   Add more test cases. (Dominique Pelle, closes vim/vim#1685)

79a213d6a4

NA / already applied:
---------------------
vim-patch:8.0.0421: diff mode wrong when adding line at end of buffer
Problem:    Diff mode is displayed wrong when adding a line at the end of a
            buffer.
Solution:   Adjust marks in diff mode. (James McCoy, closes vim/vim#1329)
f58a8475e1
2018-01-21 12:21:47 +01:00
ckelsel
9db4dc971d vim-patch:8.0.0301 #7685
Problem:    No tests for ":set completion" and various errors of the :set
            command.
Solution:   Add more :set tests. (Dominique Pelle, closes vim/vim#1440)
698f8b207b

---

Also move test_options from test_alot to Makefile.  (That's done upstream
in Vim patch 8.0.0430.)
2018-01-21 11:22:43 +01:00
Marvim the Paranoid Android
72422b0748 version.c: update [ci skip] (#7828) 2018-01-21 11:04:39 +01:00
Justin M. Keyes
eb4aab7173 ui: forward 'linespace' option #7883
ref #7520
2018-01-21 09:39:12 +01:00
Justin M. Keyes
ada1956206
Merge #7880 'lua/executor: Remove lightuserdata' 2018-01-21 08:09:16 +01:00
KunMing Xie
6bf359fa79 vim-patch:8.0.0426: insufficient testing for statusline (#7882)
Problem:    Insufficient testing for statusline.
Solution:   Add several tests. (Dominique Pelle, closes vim/vim#1534)

300af82eca
2018-01-21 06:50:31 +01:00
ZyX
db346b5b48 lua/executor: Remove all places where lightuserdata is used
Should fix problems with luajit+arm64.

Fixes #7879
Ref LuaJIT/LuaJIT#230
2018-01-21 01:47:46 +03: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
Justin M. Keyes
5a96a9eba2 free_buf_options(): free buf_T.b_kmap_ga
ASAN log:

    ==23244==ERROR: LeakSanitizer: detected memory leaks

    Direct leak of 3348 byte(s) in 228 object(s) allocated from:
        0 0x4ee3d3 in malloc /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:67:3
        1 0xf4e681 in try_malloc /home/travis/build/neovim/neovim/src/nvim/memory.c:87:15
        2 0xf4e8a9 in xmalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:121:15
        3 0xf4ee68 in xmallocz /home/travis/build/neovim/neovim/src/nvim/memory.c:196:15
        4 0x170e3ee in vim_strnsave /home/travis/build/neovim/neovim/src/nvim/strings.c:70:28
        5 0x73b2ff in ex_loadkeymap /home/travis/build/neovim/neovim/src/nvim/digraph.c:1814:16
        6 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        7 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        8 0xaee67d in do_source /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2970:3
        9 0xae82ae in source_callback /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2326:9
        10 0xae7adf in do_in_path /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2404:15
        11 0xae7f48 in do_in_path_and_pp /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2448:12
        12 0xae8281 in source_in_path /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2496:10
        13 0xae610c in source_runtime /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2490:10
        14 0x739887 in keymap_init /home/travis/build/neovim/neovim/src/nvim/digraph.c:1755:9
        15 0x11d423e in did_set_string_option /home/travis/build/neovim/neovim/src/nvim/option.c:2678:16
        16 0x11eecc4 in set_string_option /home/travis/build/neovim/neovim/src/nvim/option.c:2409:27
        17 0x119852f in set_option_value /home/travis/build/neovim/neovim/src/nvim/option.c:4849:14
        18 0x11bccac in set_bool_option /home/travis/build/neovim/neovim/src/nvim/option.c:3984:7
        19 0x11a9d50 in do_set /home/travis/build/neovim/neovim/src/nvim/option.c:1424:30
        20 0xb8caf7 in ex_set /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:9764:9
        21 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        22 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        23 0x818b42 in call_user_func /home/travis/build/neovim/neovim/src/nvim/eval.c:21315:3
        24 0x7e41bb in call_func /home/travis/build/neovim/neovim/src/nvim/eval.c:6358:11
        25 0x7f8fb8 in get_func_tv /home/travis/build/neovim/neovim/src/nvim/eval.c:6120:11
        26 0x7f1ba1 in ex_call /home/travis/build/neovim/neovim/src/nvim/eval.c:2735:9
        27 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        28 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        29 0x837ef1 in ex_execute /home/travis/build/neovim/neovim/src/nvim/eval.c:19463:7

    Direct leak of 456 byte(s) in 228 object(s) allocated from:
        0 0x4ee3d3 in malloc /local/mnt/workspace/tmp/ubuntu_rel/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:67:3
        1 0xf4e681 in try_malloc /home/travis/build/neovim/neovim/src/nvim/memory.c:87:15
        2 0xf4e8a9 in xmalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:121:15
        3 0xf4ee68 in xmallocz /home/travis/build/neovim/neovim/src/nvim/memory.c:196:15
        4 0x170e3ee in vim_strnsave /home/travis/build/neovim/neovim/src/nvim/strings.c:70:28
        5 0x73b18f in ex_loadkeymap /home/travis/build/neovim/neovim/src/nvim/digraph.c:1811:18
        6 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        7 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        8 0xaee67d in do_source /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2970:3
        9 0xae82ae in source_callback /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2326:9
        10 0xae7adf in do_in_path /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2404:15
        11 0xae7f48 in do_in_path_and_pp /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2448:12
        12 0xae8281 in source_in_path /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2496:10
        13 0xae610c in source_runtime /home/travis/build/neovim/neovim/src/nvim/ex_cmds2.c:2490:10
        14 0x739887 in keymap_init /home/travis/build/neovim/neovim/src/nvim/digraph.c:1755:9
        15 0x11d423e in did_set_string_option /home/travis/build/neovim/neovim/src/nvim/option.c:2678:16
        16 0x11eecc4 in set_string_option /home/travis/build/neovim/neovim/src/nvim/option.c:2409:27
        17 0x119852f in set_option_value /home/travis/build/neovim/neovim/src/nvim/option.c:4849:14
        18 0x11bccac in set_bool_option /home/travis/build/neovim/neovim/src/nvim/option.c:3984:7
        19 0x11a9d50 in do_set /home/travis/build/neovim/neovim/src/nvim/option.c:1424:30
        20 0xb8caf7 in ex_set /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:9764:9
        21 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        22 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        23 0x818b42 in call_user_func /home/travis/build/neovim/neovim/src/nvim/eval.c:21315:3
        24 0x7e41bb in call_func /home/travis/build/neovim/neovim/src/nvim/eval.c:6358:11
        25 0x7f8fb8 in get_func_tv /home/travis/build/neovim/neovim/src/nvim/eval.c:6120:11
        26 0x7f1ba1 in ex_call /home/travis/build/neovim/neovim/src/nvim/eval.c:2735:9
        27 0xb1ef4c in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2242:5
        28 0xb011b3 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:609:20
        29 0x837ef1 in ex_execute /home/travis/build/neovim/neovim/src/nvim/eval.c:19463:7

    SUMMARY: AddressSanitizer: 3804 byte(s) leaked in 456 allocation(s).
    Failed: E /tests/oldtests|logs :: Runtime errors detected.
2018-01-20 15:35:08 +01:00
Matthieu Coudron
6a826fce91 busted: explicit LUA_PATH to test scripts (#7864)
in case LUA_PATH does not contain `./?.lua`, busted can not load lua test scripts.
(for instance on nixos). Thus we make it explicit.
2018-01-20 14:43:16 +01:00
Marco Hinz
ecf851bc60
Merge #7867 'Add completion for :checkhealth'
Add completion for :checkhealth
2018-01-20 13:15:21 +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
George Zhao
10b1738f59 Fix lint error in option.c 2018-01-19 13:01:30 +08:00
George Zhao
82adba0f2f Fix for lint 2018-01-19 13:01:30 +08:00
George Zhao
e76c6e2ee8 Fix warning: multi-line comment [-Wcomment] use :341,355s/: \zs.*/\=string(submatch(0)) 2018-01-19 13:01:29 +08:00
George Zhao
2408a05151 Fix warning, read/write have unsigned int count on windows. 2018-01-19 13:01:29 +08:00
Justin M. Keyes
94f4469638 man.vim: infer $MANPAGER invocation in more cases
This should handle most cases where Nvim was invoked as $MANPAGER.

Ultimately the stakes are low: :quit will prompt if there are unsaved
changes.

fix #7873
2018-01-19 02:05:23 +01:00
Justin M. Keyes
20e0cb8d47 Merge #7424 'vim-patch: 8.0.0198, 8.0.0200, 8.0.0201, 8.0.0202, 8.0.0204' 2018-01-18 22:58:50 +01:00