aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/typval.c
Commit message (Collapse)AuthorAge
* vim-patch:8.1.1579: dict and list could be GC'ed while displaying errorJan Edmund Lazo2020-01-05
| | | | | | | | | Problem: Dict and list could be GC'ed while displaying error in a timer. (Yasuhiro Matsumoto) Solution: Block garbage collection when executing a timer. Add test_garbagecollect_soon(). Add "no_wait_return" to test_override(). (closes vim/vim#4571) https://github.com/vim/vim/commit/adc6714aac20f5462a0ecec50ab4806b2f3ab0db
* vim-patch:8.2.0030: "gF" does not work on output of "verbose command"Jan Edmund Lazo2019-12-22
| | | | | | Problem: "gF" does not work on output of "verbose command". Solution: Recognize " line " and translations. (closes vim/vim#5391) https://github.com/vim/vim/commit/64e74c9cc7d5aab215cf72d9bdd3aac32e128191
* dictwatcher: fix use-after-free #11495erw72019-12-02
| | | | | fixes #11494
* free_buffer: rework b:changedtick handling #9163Justin M. Keyes2019-08-12
| | | | | | | | | | | | | | | | | | | | - Re-enable Test_BufLeave_Wipe. 66f5e5c7d7ce This is my (probably-wrong) application of Zyx's suggestion in #9163: > free_buffer_stuff() already removes changedtick. It is better to > make `free_options` a flag variable and avoid calling > buf_init_changedtick() based on some flag there: current workflow > looks weird as it first removes `b:changedtick`, then re-adds it > by calling buf_init_changedtick(), then remove again. > Also based on my understanding it looks logical to not remove > `b:changedtick`, but to *replace* it with something allocated if > needed based on examining reference count before calling > `unref_var_dict`. Because now you have key disappearing from > dictionary for no good reason. Patch-By: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
* vim-patch:8.1.0167: lock flag in new dictitem is reset in many placesJan Edmund Lazo2019-06-23
| | | | | | Problem: Lock flag in new dictitem is reset in many places. Solution: Always reset the lock flag. https://github.com/vim/vim/commit/c89d4b35300b98cf68b14c89c8e1add51bd857e3
* vim-patch:8.1.0642: swapinfo() leaks memoryJustin M. Keyes2019-04-29
| | | | | | Problem: swapinfo() leaks memory. Solution: Avoid allocating the strings twice. https://github.com/vim/vim/commit/e6fdf79980c0f2856700d4f46de700293f477429
* vim-patch:8.1.0615: get_tv function names are not consistent (#9386)Daniel Hahler2018-12-22
| | | | | | | Problem: Get_tv function names are not consistent. Solution: Rename to tv_get. https://github.com/vim/vim/commit/d155d7a8519987361169459b8d464ae1caef5e9c Only a change in comments appears to be necessary.
* src/nvim/eval.cMichaHoffmann2018-10-07
| | | | | | | | | | src/nvim/eval/typval.c src/nvim/fileio.c src/nvim/main.c src/nvim/regexp_nfa.c src/nvim/spellfile.c changed some EMSG[..] Macros to emsgf
* add func_attr_printf in :MichaHoffmann2018-09-24
| | | | | | | | | | | | | | | | | | | | | | log.c message.c strings.c fixed some printf warnings in: src/nvim/undo.c src/nvim/eval.c src/nvim/eval/encode.c src/nvim/eval/typval.c src/nvim/ex_getln.c src/nvim/fileio.c src/nvim/lua/executor.c src/nvim/main.c src/nvim/regexp_nfa.c src/nvim/shada.c src/nvim/spellfile.c src/nvim/tui/terminfo.c src/nvim/garray.h
* shell/logging: Fix E730 with verbose system({List}) #9009Justin M. Keyes2018-09-21
| | | | | | | | ref https://github.com/neovim/neovim/issues/9001#issuecomment-421843790 Steps to reproduce: :set verbose=9 :call system(['echo']) E730: using List as a String
* vim-patch:8.0.0593: DRY: setting list/dict return value (#8639)Jan Edmund Lazo2018-06-30
| | | | | Problem: Duplication of code for adding a list or dict return value. Solution: Add rettv_dict_set() and rettv_list_set(). (Yegappan Lakshmanan) https://github.com/vim/vim/commit/45cf6e910c6d162775ca9d470fac4b6db844001f
* eval/typval: Silence PVS/V576: format is correctZyX2018-04-22
|
* eval/typval: Log list actionsZyX2018-01-14
| | | | | | | | | | 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.
* *: Provide list length when allocating listsZyX2018-01-14
|
* Add another const to tv_copyPaul Rigge2018-01-02
| | | | | | | | | Clang static analyzer had trouble with filter_map in eval.c because tv_copy could, in principle, change the v_type of argvars[0]. It saw a potential null pointer going somewhere it shouldn't as a result. The from argument in tv_copy should be const, which also cleans up the static analyzer's complaint.
* eval: Refactor some potentially dangerous list appendsZyX2017-12-25
|
* *: Fix linter errorsZyX2017-12-24
|
* eval: Replace some tv_list_item_remove() callsZyX2017-12-24
| | | | | There is nothing wrong with them, just it is generally better to remove a range then to remove items individually.
* eval: Rename tv_list_remove_items() to tv_list_drop_items()ZyX2017-12-24
| | | tv_list_remove_items() may cause confusion with tv_list_item_remove()
* eval/typval: Make tv_list_item_remove return pointer to the next itemZyX2017-12-24
|
* eval/typval: Remove tv_list_item_free() as it is unusedZyX2017-12-24
|
* eval/typval: Make tv_list_item_alloc staticZyX2017-12-24
| | | | Better write this bit in lua then make reviewers or clint filter out tv_list_item_alloc().
* *: Remove most calls to tv_list_item_allocZyX2017-12-24
| | | | 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.
* Merge branch 'master' into hide-container-implZyX2017-12-16
|\
| * typval_encode.c.h: avoid -Wnonnull-compare warning (#7712)Justin M. Keyes2017-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | *: Fix some problems found during reviewZyX2017-12-15
| | | | | | | | Still missing: problems in window.c, it should be possible to construct a test for them.
* | *: Fix linter errorsZyX2017-12-11
| |
* | *: Finish hiding list implementationZyX2017-12-11
| |
* | *: Start hiding list implementationZyX2017-12-10
|/ | | | Most of files, except for eval.c and eval/* were only processed by perl.
* channels: allow bytes sockets and stdio, and buffered bytes outputBjörn Linse2017-11-24
|
* channels: refactorBjörn Linse2017-11-24
|
* cmdline: CmdlineEnter and CmdlineLeave autocommands (#7422)Björn Linse2017-11-22
| | | | | | | | | | 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. https://github.com/vim/vim/commit/fafcf0dd59fd9c4ef743bb333ae40d1d322b6079
* eval/typval: Add tv_dict_add_allocated_str() functionZyX2017-07-02
|
* *: Fix conversion warnings for tv_get_number*()James McCoy2017-06-06
|
* eval/typval: Convert string to varnumber_T instead of intermediate longJames McCoy2017-06-06
|
* Merge #6480 from ZyX-I/colored-cmdline'/input-dictJustin M. Keyes2017-05-13
|\
| * eval/typval: Fix numbuf parameter documentationZyX2017-05-13
| |
| * eval: Refactor get_user_input to support dictionaryZyX2017-05-10
| |
* | *: Use __attribute__((fallthrough)) where comments aren't supportedJames McCoy2017-05-12
|/ | | | | | | | | 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
* Merge branch 'master' into lazier-arg_errmsg-gettextZyX2017-04-21
|\
| * *: Add comment to all C filesZyX2017-04-19
| |
| * eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_alloc_retZyX2017-04-15
| | | | | | | | Same as tv_list_alloc, but additionally ret_tv receives pointer to the newly allocated list.
| * eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_allocZyX2017-04-15
| | | | | | | | | | | | 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.
| * eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_item_copyZyX2017-04-15
| | | | | | Allocated storage may receive pointer to the list after tv_copy().
| * eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_allocZyX2017-04-15
| | | | | | | | Allocated list points to previously allocated list. Allocated list is saved to gc_first_list.
* | eval/typval: Do not translate tv_clear argument, this is uselessZyX2017-04-15
| |
* | eval: Add comment regarding why special values are neededZyX2017-04-14
| |
* | eval: Change the point at which arg_errmsg and its length are changedZyX2017-04-14
|/ | | | Ref #6437
* perf: tv_clear(): Cache gettext() result. (#6519)Justin M. Keyes2017-04-14
| | | Closes #6437
* eval/typval,api/buffer: Fix review commentsZyX2017-03-29
|