Commit Graph

10040 Commits

Author SHA1 Message Date
George Zhao
06994e0e21 Fix warning about conversion on mingw64 2018-01-18 21:30:03 +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
zandrmartin
8fc437ef43 runtime: UpdateRemotePlugins: allow bar (#7865) 2018-01-17 20:50:17 +01:00
Justin M. Keyes
1c6e956079
Merge #7862 'fix resize-related segfaults' 2018-01-16 10:10:02 +01:00
Justin M. Keyes
fed928b438 ugrid.c: destroy_cells(): avoid double-free
https://github.com/neovim/neovim/issues/7572#issuecomment-345257295
2018-01-16 09:38:08 +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
c06995b34d
Merge #7858 'vim-patch: spell-related patches' 2018-01-16 02:14:41 +01:00
Justin M. Keyes
9cabe826ba lint 2018-01-16 01:12:16 +01:00
Justin M. Keyes
b558f750bf vim-patch:8.0.1419: cursor column is not updated after ]s
Problem:    Cursor column is not updated after ]s. (Gary Johnson)
Solution:   Set the curswant flag.

b73fa629d6
2018-01-16 00:13:22 +01:00
Justin M. Keyes
6020e8b69e vim-patch:8.0.1225: no check for spell region being zero
Problem:    No check for spell region being zero. (geeknik)
Solution:   Check for zero. (closes vim/vim#2252)

ee03b94124
2018-01-16 00:08:22 +01:00
Justin M. Keyes
fe7a53f3cf test/old: skip enc=latin1 tests 2018-01-16 00:06:59 +01:00
Justin M. Keyes
682d5ff8e6 vim-patch:8.0.0792: spell test leaves files behind
Problem:    Spell test leaves files behind.
Solution:   Delete the files.

1a0f200500
2018-01-16 00:04:13 +01:00
Justin M. Keyes
34cc04d753 vim-patch:8.0.0658: spell test is old style
Problem:    Spell test is old style.
Solution:   Turn the spell test into a new style test (pschuh, closes vim/vim#1778)

d2c061d24c
2018-01-16 00:03:05 +01:00
Justin M. Keyes
3f9f7cfab1 vim-patch:8.0.0601: no test coverage for :spellrepall
Problem:    No test coverage for :spellrepall.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#1717)

545cb79da5
2018-01-16 00:01:19 +01:00
Justin M. Keyes
2b1bcd446b runtime: include en.utf-8.spl
Install en.utf-8.spl by default.

- Allows spell-related tests to run.
- Avoids download prompt for spelllang=en users
2018-01-15 23:58:52 +01:00
KunMing Xie
26251d6d06 vim-patch:8.0.0374: invalid memory access when using :sc in Ex mode (#7849)
Problem:    Invalid memory access when using :sc in Ex mode. (Dominique Pelle)
Solution:   Avoid the column being negative.  Also fix a hang in Ex mode.

ba748c8a84
2018-01-15 23:54:56 +01: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
Justin M. Keyes
de0a9548f7
Merge #7806 from ZyX-I/list-stat
Add a way to collect list usage statistics
2018-01-15 23:35:20 +01:00
Justin M. Keyes
726197d890 Merge #7850 'vim patches' 2018-01-15 22:42:52 +01:00
Justin M. Keyes
f09a30d5b0
Merge #7839 'coverity fixes' 2018-01-15 22:31:11 +01:00
Justin M. Keyes
900708f93b
Merge #7855 from ckelsel/vim-8.0.0398 2018-01-15 22:10:05 +01:00
Felipe Morales
7dd3910f47 tutor: don't resize (#7854) 2018-01-15 21:59:37 +01:00
mkotha
ac87d9de69 Fix an off-by-one error in the documentation of nvim_buf_clear_highlight (#7853) 2018-01-15 21:45:10 +01:00
Filip Szymański
423d7af3df man.lua: avoid float conversion on lua 5.3 (#7851)
Error detected while processing function man#open_page[58]..<SNR>54_put_page:
    line    8:
    E5105: Error while calling lua chunk: /usr/share/nvim/runtime/lua/man.lua:165: Vim(let):E805: Using a Float as a Number
2018-01-15 20:14:27 +01:00
ckelsel
808f504305 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-15 20:20:15 +08:00
ckelsel
28998cfd81 vim-patch:8.0.0402: :map completion does not have <special>
Problem:    :map completion does not have <special>. (Dominique Pelle)
Solution:   Recognize <special> in completion.  Add a test.

cf5fdf7d16
2018-01-15 19:48:18 +08:00
ckelsel
63bb7198df vim-patch:8.0.0398: illegal memory access with "t"
Problem:    Illegal memory access with "t".
Solution:   Use strncmp() instead of memcmp(). (Dominique Pelle, closes vim/vim#1528)

66727e1607
2018-01-15 19:41:01 +08:00
ckelsel
b9f3805447 vim-patch:8.0.0406: arabic shaping code is verbose
Problem:    The arabic shaping code is verbose.
Solution:   Shorten the code without changing the functionality.

7f73b54631
2018-01-15 19:16:04 +08:00
ckelsel
770ec228c7 vim-patch:8.0.0391: arabic support is verbose and not well tested
Problem:    Arabic support is verbose and not well tested.
Solution:   Simplify the code.  Add more tests.

5f53dd3f74
2018-01-15 18:18:59 +08:00
ckelsel
fc97e9fbdf vim-patch:8.0.0389: test for arabic does not check what is displayed
Problem:    Test for arabic does not check what is displayed.
Solution:   Improve what is asserted. (Dominique Pelle, closes vim/vim#1523)
            Add a first shaping test.

5342f00ff9
2018-01-15 17:33:13 +08:00
ckelsel
fe4ba69958 vim-patch:8.0.0385: no tests for arabic
Problem:    No tests for arabic.
Solution:   Add a first test for arabic. (Dominique Pelle, closes vim/vim#1518)

b5e8377364
2018-01-14 20:57:27 +08:00
ckelsel
7faeaf9f24 vim-patch:8.0.0381: diff mode is not sufficiently tested
Problem:    Diff mode is not sufficiently tested.
Solution:   Add more diff mode tests. (Dominique Pelle, closes vim/vim#1515)

aeb661e1f4
2018-01-14 20:50:59 +08:00
ckelsel
4b8d6caf48 vim-patch:8.0.0380: with 'linebreak' double wide char wraps badly
Problem:    With 'linebreak' set and 'breakat' includes ">" a double-wide
            character results in "<<" displayed.
Solution:   Check for the character not to be replaced. (Ozaki Kiichi,
            closes vim/vim#1456)

38632faf63
2018-01-14 20:50:35 +08:00
ZyX
a8cb510a2e channel: Make empty output be represented by [''] again 2018-01-14 01:33:18 +03:00
ZyX
6a1557f2f4 eval/typval: Log list actions
New logging is guarded by cmake LOG_LIST_ACTIONS define. To make it more
efficient it is allocated as a linked list with chunks of length
2^(7+chunk_num); that uses basically the same idea as behind increasing kvec
length (make appending O(1) (amortized)), but reduces constant by not bothering
to move memory around what realloc() would surely do: it is not like we need
random access to log entries here to justify usage of a single continuous memory
block.
2018-01-14 01:33:18 +03:00
ZyX
c10ae4bc85 os/fileio: Fix some flag names in file_* functions documentation 2018-01-14 01:33:17 +03:00
ZyX
9ea1752d60 *: Provide list length when allocating lists 2018-01-14 01:33:16 +03:00
Justin M. Keyes
8eb0888a5d vim-patch:8.0.0582: illegal memory access with z= command
Problem:    Illegal memory access with z= command. (Dominique Pelle)
Solution:   Avoid case folded text to be longer than the original text.  Use
            MB_PTR2LEN() instead of MB_BYTE2LEN().

5b276aa80e
2018-01-13 19:42:07 +01:00
KunMing Xie
9ddeb6e187 vim-patch:8.0.0364 (#7837)
vim-patch:8.0.0364: ]s does not move cursor with two spell errors in one line

Problem:    ]s does not move cursor with two spell errors in one line. (Manuel
            Ortega)
Solution:   Don't stop search immediately when wrapped, search the line first.
            (Ken Takata)  Add a test.

d3f78dc9eb

* disable spell test for now
2018-01-13 19:26:21 +01:00
Justin M. Keyes
624ac8aede coverity/161216: get_user_input: RETURN_LOCAL
*** CID 161216:  Memory - illegal accesses  (RETURN_LOCAL)
    /src/nvim/eval.c: 11143 in get_user_input()
    11137       rettv->vval.v_string =
    11138         (char_u *)getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr,
    11139                                     xp_type, xp_arg, input_callback);
    11140       ex_normal_busy = save_ex_normal_busy;
    11141       callback_free(&input_callback);
    11142
    >>>     CID 161216:  Memory - illegal accesses  (RETURN_LOCAL)
    >>>     Using "cancelreturn", which points to an out-of-scope variable "def".
    11143       if (rettv->vval.v_string == NULL && cancelreturn != NULL) {
    11144         rettv->vval.v_string = (char_u *)xstrdup(cancelreturn);
    11145       }
    11146
    11147       xfree(xp_arg);
    11148
2018-01-11 10:45:16 +01:00
Justin M. Keyes
18d244eded coverity/169163: decode_string: Null pointer deref
*** CID 169163:  Null pointer dereferences  (FORWARD_NULL)
    /src/nvim/eval/decode.c: 290 in decode_string()
    284         if (elw_ret == -1) {
    285           tv_clear(&tv);
    286           return (typval_T) { .v_type = VAR_UNKNOWN, .v_lock = VAR_UNLOCKED };
    287         }
    288         return tv;
    289       } else {
    >>>     CID 169163:  Null pointer dereferences  (FORWARD_NULL)
    >>>     Passing null pointer "s" to "xmemdupz", which dereferences it. (The dereference is assumed on the basis of the 'nonnull' parameter attribute.)
    290         return (typval_T) {
    291           .v_type = VAR_STRING,
    292           .v_lock = VAR_UNLOCKED,
    293           .vval = { .v_string = (char_u *)(
    294               s_allocated ? (char *)s : xmemdupz(s, len)) },
    295         };
2018-01-11 10:45:16 +01:00
Justin M. Keyes
911b1e49ab
Merge #7821 'api: nvim_command_output' 2018-01-11 10:39:41 +01: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
f0845197d8 ci/travis: require "sudo" for ASAN_UBSAN build
Workaround for this fun new issue:

    ==27404==LeakSanitizer has encountered a fatal error.
    ==27404==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
    ==27404==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
    Failed: E /build|logs :: Runtime errors detected.

https://github.com/travis-ci/travis-ci/issues/9033
https://github.com/google/sanitizers/issues/764
2018-01-10 23:35:10 +01:00
Justin M. Keyes
a8ad6b4d51 cmake: install *.lua files 2018-01-09 11:37:49 +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
0ed31303b5
Merge #7826 from ckelsel/vim-8.0.0351 2018-01-08 22:23:05 +01:00