ZyX
67fa9e5237
eval: Rename tv_list_remove_items() to tv_list_drop_items()
...
tv_list_remove_items() may cause confusion with tv_list_item_remove()
2017-12-24 16:38:30 +03:00
ZyX
ac55558c97
eval/typval: Make tv_list_item_remove return pointer to the next item
2017-12-24 14:09:36 +03:00
ZyX
608c3d7baf
eval/typval: Remove tv_list_item_free() as it is unused
2017-12-24 14:09:36 +03:00
ZyX
6bf3dc77c4
eval/typval: Make tv_list_item_alloc static
...
Better write this bit in lua then make reviewers or clint filter out
tv_list_item_alloc().
2017-12-24 14:09:36 +03:00
ZyX
0c533a488f
*: Remove most calls to tv_list_item_alloc
...
Still left calls in eval/typval.c and test/unit/eval/helpers.lua. Latter is the
only reason why function did not receive `static` modifier.
2017-12-24 14:09:35 +03:00
ZyX
7f3b9a4acc
Merge branch 'master' into hide-container-impl
2017-12-16 14:27:41 +03:00
ZyX
c8a5d6181b
*: Fix some problems found during review
...
Still missing: problems in window.c, it should be possible to construct a test
for them.
2017-12-15 02:39:46 +03:00
Justin M. Keyes
7164f61850
typval_encode.c.h: avoid -Wnonnull-compare warning ( #7712 )
...
* typval_encode.c.h: avoid -Wnonnull-compare warning
closes #6847
The NULL check is needed because TYPVAL_ENCODE_CONV_EMPTY_DICT may be
invoked with literal `NULL`.
Warning occurs even for `Debug` build-type:
neovim/src/nvim/eval/typval.c: In function ‘_typval_encode_nothing_convert_one_value’:
neovim/src/nvim/eval/typval.c:1802:10: warning: nonnull argument ‘tv’ compared to NULL [-Wnonnull-compare]
if (tv != NULL) { \
^
../src/nvim/eval/typval_encode.c.h:398:9: note: in expansion of macro ‘TYPVAL_ENCODE_CONV_EMPTY_DICT’
TYPVAL_ENCODE_CONV_EMPTY_DICT(tv, tv->vval.v_dict);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc version:
gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
* fixup! typval_encode.c.h: avoid -Wnonnull-compare warning
2017-12-13 22:22:02 +01:00
ZyX
f4132fb38b
*: Fix linter errors
2017-12-11 10:19:20 +03:00
ZyX
d46e37cb4c
*: Finish hiding list implementation
2017-12-11 10:12:59 +03:00
ZyX
274f32d42e
*: Start hiding list implementation
...
Most of files, except for eval.c and eval/* were only processed by perl.
2017-12-10 04:00:52 +03:00
Björn Linse
1ebc96fe10
channels: allow bytes sockets and stdio, and buffered bytes output
2017-11-24 14:54:15 +01:00
Björn Linse
5215e3205a
channels: refactor
2017-11-24 14:50:00 +01:00
Björn Linse
a4f6cec7a3
cmdline: CmdlineEnter and CmdlineLeave autocommands ( #7422 )
...
vim-patch:fafcf0dd59fd
patch 8.0.1206: no autocmd for entering or leaving the command line
Problem: No autocmd for entering or leaving the command line.
Solution: Add CmdlineEnter and CmdlineLeave.
fafcf0dd59
2017-11-22 22:35:20 +01:00
ZyX
df040e55fb
eval/typval: Add tv_dict_add_allocated_str() function
2017-07-02 19:01:09 +03:00
James McCoy
af59a290d8
*: Fix conversion warnings for tv_get_number*()
2017-06-06 21:38:31 -04:00
James McCoy
2109fb18e6
eval/typval: Convert string to varnumber_T instead of intermediate long
2017-06-06 07:56:03 -04:00
Justin M. Keyes
17531ed082
Merge #6480 from ZyX-I/colored-cmdline'/input-dict
2017-05-13 21:17:33 +02:00
ZyX
d66ef56739
eval/typval: Fix numbuf parameter documentation
2017-05-13 17:01:22 +03:00
James McCoy
5ec72aadbf
*: Use __attribute__((fallthrough)) where comments aren't supported
...
Although GCC now detects possibly unintentional fall through, there
rules around which the comments are detected are rather strict. In
cases where a comment isn't detected, upstream [recommends] using their
fallthrough attribute.
[recommends]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77817#c11
2017-05-12 17:07:25 -04:00
ZyX
f4d5d5250a
eval: Refactor get_user_input to support dictionary
2017-05-10 15:52:48 +03:00
ZyX
d463c9e03a
Merge branch 'master' into lazier-arg_errmsg-gettext
2017-04-21 00:33:12 +03:00
ZyX
c2f3e361c5
*: Add comment to all C files
2017-04-19 19:11:50 +03:00
ZyX
82ba2891ae
eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_alloc_ret
...
Same as tv_list_alloc, but additionally ret_tv receives pointer to the newly
allocated list.
2017-04-15 19:19:22 +03:00
ZyX
af3579d5f7
eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_alloc
...
Allocated dict points to previously allocated dict.
Queue in allocated dict points to itself.
Hashtab in allocated dict points to inside itself.
Allocated dict is saved to gc_first_dict.
2017-04-15 19:18:25 +03:00
ZyX
b9004d7448
eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_item_copy
...
Allocated storage may receive pointer to the list after tv_copy().
2017-04-15 19:16:40 +03:00
ZyX
b08b71c728
eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_alloc
...
Allocated list points to previously allocated list.
Allocated list is saved to gc_first_list.
2017-04-15 19:16:00 +03:00
ZyX
31fd6d4bbf
eval/typval: Do not translate tv_clear argument, this is useless
2017-04-15 00:00:22 +03:00
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
45b5ebea9d
perf: tv_clear(): Cache gettext() result. ( #6519 )
...
Closes #6437
2017-04-14 17:41:59 +02:00
ZyX
114eaa15f0
eval/typval,api/buffer: Fix review comments
2017-03-29 10:08:46 +03:00
ZyX
58e34e8d99
eval/typval: Allow NULL dict as tv_dict_get_callback() argument
...
Also removes NULL key input: tv_dict_find() does not allow this.
2017-03-29 10:08:46 +03:00
ZyX
e08b27ba4a
unittests: Add tv_get number tests
2017-03-29 10:08:46 +03:00
ZyX
630ff33dc1
unittests: Test locks section
2017-03-29 10:08:46 +03:00
ZyX
f0bbd1e825
unittests: Add tests for tv_clear()
2017-03-29 10:08:46 +03:00
ZyX
43e9fad1c8
eval: Use tv_is_func in place of ==VAR_FUNC||==VAR_PARTIAL
...
Also fixes same error as in vim/vim#1557
2017-03-29 10:08:45 +03:00
ZyX
270a3889af
unittests: Add tv_dict_add* unit tests
...
Also fixes incorrect location of `tv_dict_add` function and three bugs in other
functions:
1. `tv_dict_add_list` may free list it does not own (vim/vim#1555 ).
2. `tv_dict_add_dict` may free dictionary it does not own (vim/vim#1555 ).
3. `tv_dict_add_dict` ignores `key_len` argument.
2017-03-29 10:08:45 +03:00
ZyX
b222453c95
eval/typval: Refactor errors a bit: use emsgf always
2017-03-29 10:08:45 +03:00
ZyX
38dd81c136
eval/typval: Fix SEGV in test_alot.vim test
2017-03-29 10:08:45 +03:00
ZyX
78a0de2c1b
eval/typval: Fix -Werror=return-type
2017-03-29 10:08:45 +03:00
ZyX
506b938947
*: Make some more things const and with length
2017-03-29 10:08:44 +03:00
ZyX
3025431c81
eval: Make sure that v:_null_dict does not crash dictwatcher*()
...
Ref #4615
2017-03-29 10:08:44 +03:00
ZyX
1e3e302dc2
eval: Move part of dictwatcher* functions to eval/typval
2017-03-29 10:08:44 +03:00
ZyX
9ed9af7e11
eval/typval: More const qualifiers in tv_dict* function signatures
2017-03-29 10:08:06 +03:00
ZyX
56e51033ab
unittests: Add tests for tv_list_idx_of_item
2017-03-29 10:08:06 +03:00
ZyX
e5edf07ec4
unittests: Add tests for tv_list_find*() functions
...
Additional modifications:
- More `const` qualifiers in tested functions.
- `tv_list_find_str()` second argument is more in-line with other
`tv_list_find*()` functions.
2017-03-29 10:08:06 +03:00
ZyX
b3672ae2fc
eval/typval: Add tv_list_equal() tests, compare NULL lists equal
2017-03-29 10:08:06 +03:00
ZyX
7ceebacb3f
eval/typval,tests: Fix extending list with itself, add tests
...
Adds unit test for tv_list_extend and regression test for extend() VimL
function.
2017-03-29 10:08:06 +03:00
ZyX
56e4c2f67e
unittests: Test tv_list_concat()
2017-03-29 10:08:06 +03:00