Commit Graph

10177 Commits

Author SHA1 Message Date
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
dvejmz
34de6d33c9 lint 2018-01-09 22:58:24 +00:00
dvejmz
b23fc444b5 vim-patch:8.0.0204: compiler warns for uninitialized variable
Problem:    Compiler warns for uninitialized variable. (Tony Mechelynck)
Solution:   When skipping set "id" to -1.

eb46f8fa14
2018-01-09 22:11:16 +00:00
dvejmz
e888439f55 vim-patch:8.0.0202: no test for invalid syntax group name
Problem:    No test for invalid syntax group name.
Solution:   Add a test for group name error and warning.

4007ed4a5e
2018-01-09 22:11:16 +00:00
dvejmz
7f70c5f7b7 vim-patch:8.0.0201: completion of highlight groups includes cleared names
Problem:    When completing a group name for a highlight or syntax command
            cleared groups are included.
Solution:   Skip groups that have been cleared.

d61e8aaae5
2018-01-09 22:11:16 +00:00
dvejmz
889bc3c20c vim-patch:8.0.0200: some syntax arguments are not tested
Problem:    Some syntax arguments are not tested.
Solution:   Add more syntax command tests.

58f60ca2fc
2018-01-09 22:11:16 +00:00
dvejmz
b58c17f8df vim-patch:8.0.0198
Problem:    Some syntax arguments take effect even after "if 0". (Taylor
            Venable)
Solution:   Properly skip the syntax statements.  Make "syn case" and "syn
            conceal" report the current state.  Fix that "syn clear" didn't
            reset the conceal flag.  Add tests for :syntax skipping properly.

de318c5c35
2018-01-09 22:11:15 +00: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
ckelsel
e182a8c836 vim-patch:8.0.0352: not easy to see when a typval needs to be cleared
Problem:    The condition for when a typval needs to be cleared is too
            complicated.
Solution:   Init the type to VAR_UNKNOWN and clear it always.

f06e5a549f
2018-01-08 13:23:05 +08:00
ckelsel
b61a305039 vim-patch:8.0.0351: no test for concatenating an empty string
Problem:    No test for concatenating an empty string that results from out of
            bounds indexing.
Solution:   Add a simple test.

218426896c
2018-01-08 12:24:21 +08:00
Jan Edmund Lazo
9370a0e5d8 ci/travis: install neovim npm module on osx (#7825)
Always get latest nvm on osx to fix lts aliases.
2018-01-08 00:37:31 +01:00
Justin M. Keyes
ccdbcfea0b
Merge #7820 'ci/travis/macOS: skip ruby gem install' 2018-01-07 20:34:16 +01:00
Justin M. Keyes
46a9600d0e ci/travis: macOS: skip ruby-neovim install
With 6fa0a0a516 the neovim-ruby gem installs successfully, but
ruby_spec.lua can't find it: g:ruby_host_prog needs to be set correctly.

Just skip the whole thing for now, so that CI builds don't fail.
2018-01-07 20:09:25 +01:00
Justin M. Keyes
6fa0a0a516 ci/travis: macOS: switch ruby version
Travis macOS builds are failing because of neovim-ruby gem dependencies.
Switch default ruby to a newer version to make the builds pass.
2018-01-07 20:04:57 +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