aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/typval.h
Commit message (Collapse)AuthorAge
* feat(lua): add api and lua autocmdsTJ DeVries2022-02-27
|
* feat(--headless): add on_print callback to stdioopenglacambre2022-01-24
| | | | | | | This commit adds an on_print callback to stdioopen's dictionary argument which lets the caller specify a function called each time neovim will try to output something to stdout (e.g. on "echo" or "echoerr" in --headless mode).
* refactor: saner options for uncrustify (#16204)dundargoc2021-11-19
| | | | | | | | | | | | | | | | | | | | | | | | * sp_enum_after_assign = force * sp_brace_typedef = force * nl_do_brace = remove * sp_do_brace_open = force * sp_brace_close_while = force * sp_before_semi = remove * sp_before_semi_for = remove * sp_before_semi_for_empty = remove * sp_between_semi_for_empty = remove * sp_after_semi_for_empty = remove * sp_before_square = remove * sp_before_squares = remove * sp_inside_square = remove * sp_inside_fparens = remove * sp_inside_fparen = remove * sp_inside_tparen = remove * sp_after_tparen_close = remove * sp_return_paren = force * pos_bool = lead * sp_pp_concat = remove * sp_pp_stringify = remove * fixup: disable formatting for the INIT section
* vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy2021-11-01
| | | | | | | | | Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
* refactor: saner options for uncrustify #16196dundargoc2021-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor: general good option changes sp_deref = remove sp_not = remove sp_inv = remove sp_inside_paren_cast = remove mod_remove_duplicate_include = true sp_after_semi = add sp_after_semi_for = force sp_sizeof_paren = remove nl_return_expr = remove nl_else_brace = remove nl_else_if = remove * refactor: mod_remove_extra_semicolon = true * refactor: nl_max = 3 * refactor: sp_bool = force * refactor: sp_compare = force * refactor: sp_inside_paren = remove * refactor: sp_paren_paren = remove * refactor: sp_inside_sparen = remove * refactor: sp_before_sparen = force * refactor: sp_sign = remove * refactor: sp_addr = remove * refactor: sp_member = remove * refactor: nl_struct_brace = remove * refactor: nl_before_if_closing_paren = remove * refactor: nl_fdef_brace = force * refactor: sp_paren_comma = force * refactor: mod_full_brace_do = add
* refactor: uncrustify #16090dundargoc2021-10-29
|
* refactor: format header files with uncrustify #15877dundargoc2021-10-09
| | | | | | * refactor: format header files with uncrustify * fixup(justin): skip formatting of terminfo_defs.h * fixup: force winsock2 to be included first * fixup: simplify disable/enable directive to "uncrustify:off/on"
* vim-patch:8.1.0735: cannot handle binary dataSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot handle binary data. Solution: Add the Blob type. (Yasuhiro Matsumoto, closes vim/vim#3638) https://github.com/vim/vim/commit/6e5ea8d2a995b32bbc5972edc4f827b959f2702f Nvim-specific Blob conversions are implemented in future commits. Refactor write_blob() to use a FileDescriptor, as f_writefile() was refactored to use one (does not apply to read_blob()). Use var_check_lock() in f_add() for Blobs from v8.1.0897. Add a modeline to test_blob.vim and fix some doc typos. Include if_perl.txt's VIM::Blob() documentation. Interestingly, this function already worked before this port, as it just returns a Blob string literal, not an actual Blob object. N/A patches for version.c: vim-patch:8.1.0741: viminfo with Blob is not tested Problem: Viminfo with Blob is not tested. Solution: Extend the viminfo test. Fix reading a blob. Fixed storing a special variable value. https://github.com/vim/vim/commit/8c8b8bb56c724cc1bfc3d8520eec33f2d399697c vim-patch:8.1.1022: may use NULL pointer when out of memory Problem: May use NULL pointer when out of memory. (Coverity) Solution: Check for blob_alloc() returning NULL. https://github.com/vim/vim/commit/e142a9467a7f6845a426d8db6efedf246d3c13ac
* chore: use codespell to spell check #15016dundargoc2021-07-07
|
* vim-patch:8.2.1255: cannot use a lambda with quickfix functionsJan Edmund Lazo2021-06-23
| | | | | | Problem: Cannot use a lambda with quickfix functions. Solution: Add support for lambda. (Yegappan Lakshmanan, closes vim/vim#6499) https://github.com/vim/vim/commit/d43906d2e5969288f239df851f5ad7b1dc2c7251
* Test and initial fix for crash with dictwatcherdelDaniel Hahler2021-03-30
| | | | Fixes https://github.com/neovim/neovim/issues/11188.
* vim-patch:8.2.2438: out of bounds compiler warningJan Edmund Lazo2021-03-09
| | | | | | | | | Problem: Out of bounds compiler warning. Solution: Increase the size of uf_name. https://github.com/vim/vim/commit/6a12e3342d84a1d754d793ed5019778bd60e7494 Do not set size of uf_name to avoid compiler warnings. Port only the comments.
* vim-patch:8.1.1310: named function arguments are never optionalerw72021-02-22
| | | | | | | Problem: Named function arguments are never optional. Solution: Support optional function arguments with a default value. (Andy Massimino, closes vim/vim#3952) https://github.com/vim/vim/commit/42ae78cfff171fbd7412306083fe200245d7a7a6
* vim-patch:8.1.1630: various small problemsJan Edmund Lazo2020-12-13
| | | | | | Problem: Various small problems. Solution: Various small improvements. https://github.com/vim/vim/commit/e809a4ed3014fbf717c936c727291b5f038829a5
* vim-patch:8.2.1961: various comments can be improvedJan Edmund Lazo2020-11-06
| | | | | | Problem: Various comments can be improved. Solution: Various comment adjustments. https://github.com/vim/vim/commit/22286895fce0e45e42126c7f2e35ebf43bc625d9
* lua: Add ability to pass tables with __callTJ DeVries2020-07-10
| | | | | | | | | | | | vim-patch:8.2.1054: not so easy to pass a lua function to Vim vim-patch:8.2.1084: Lua: registering function has useless code I think I have also opened up the possibility for people to use these callbacks elsewhere, since I've added a new struct that we should be able to use. Also, this should allow us to determine what the state of a list is in Lua or a dictionary in Lua, since we now can track the luaref as we go.
* lua: Add ability to pass lua functions directly to vimLTJ DeVries2020-07-10
|
* vim-patch:8.2.0111: VAR_SPECIAL is also used for booleansBilly Su2020-06-06
| | | | | | Problem: VAR_SPECIAL is also used for booleans. Solution: Add VAR_BOOL for better type checking. https://github.com/vim/vim/commit/9b4a15d5dba354d2e1e02871470bad103f34769a
* Merge #11851 'eval.c: factor out eval/userfunc.c'Justin M. Keyes2020-04-26
|\ | | | | | | vim-patch:7.4.2058
| * fix: header updatesJakub Łuczyński2020-02-13
| |
* | nvim:eval: Fix enum declaration for ListLenSpecialsAndreas Schneider2020-02-23
|/ | | | | | | | | | | Instead of declaring an enum, this creates a global variable. As gcc10 uses -fno-common by default, global variables declared with the same name more than once is not allowed anymore revealing this issue. Each time this header is included, we define the enum name as a global variable. See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680
* PVS/V618: fix emsgf format specifier #11643Husain Alshehhi2020-01-01
|
* vim-patch:8.2.0025: repeated word in comment (#11586)Jan Edmund Lazo2019-12-21
| | | | | Problem: Repeated word in comment. Solution: Remove one. (Rene Nyffenegger, closes vim/vim#5384) https://github.com/vim/vim/commit/fe72d08400d9064b3f959f1f62f279527e64835a
* Remove excess <stdint.h>Jan Edmund Lazo2019-09-11
|
* vim-patch:8.1.0515: reloading a script gives errors for existing functionserw72019-09-04
| | | | | | Problem: Reloading a script gives errors for existing functions. Solution: Allow redefining a function once when reloading a script. https://github.com/vim/vim/commit/ded5f1bed7ff2d138b3ee0f9610d17290b62692d
* vim-patch:8.1.0362: cannot get the script line number when executing a functionerw72019-09-04
| | | | | | | Problem: Cannot get the script line number when executing a function. Solution: Store the line number besides the script ID. (Ozaki Kiichi, closes vim/vim#3362) Also display the line number with ":verbose set". https://github.com/vim/vim/commit/f29c1c6aa3f365c025890fab5fb9efbe88eb1761
* vim-patch:8.1.0130: ":profdel func" does not work if func was called alreadyDaniel Hahler2019-06-08
| | | | | | | | Problem: ":profdel func" does not work if func was called already. (Dominique Pelle) Solution: Reset uf_profiling and add a flag to indicate initialization was done. https://github.com/vim/vim/commit/ad6480961080f80a455b2394f27b02935a2ded52
* vim-patch:8.0.1590: padding in list type wastes memory (#9119)Jan Edmund Lazo2018-10-13
| | | | | | Problem: Padding in list type wastes memory. Solution: Reorder struct members to optimize padding. (Dominique Pelle, closes vim/vim#2704) https://github.com/vim/vim/commit/1a840240376f2858d489736f9eed6d2975225fdf
* 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: Remove struct dictitem_S which is not used anywhereZyX2018-04-20
|
* eval: Fix PVS/V547: ufunc_T is actually an incomplete typeZyX2018-04-10
|
* build/MSVC: fix "C4003: not enough actual parameters for macro"Justin M. Keyes2018-03-18
| | | | | | For the case of TV_DICTITEM_STRUCT, we can't just pass `1` because: https://github.com/neovim/neovim/pull/8142#discussion_r175262436 > this variant will trigger array overrun warnings from various static analyzers.
* 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
|
* eval: Refactor some potentially dangerous list appendsZyX2017-12-25
|
* clint,eval: Make linter check for direct usage of list attributesZyX2017-12-12
|
* eval/typval: Fix typoZyX2017-12-11
| | | [ci skip]
* *: Finish hiding list implementationZyX2017-12-11
|
* *: Hide list implementation in other files as wellZyX2017-12-10
|
* *: Start hiding list implementationZyX2017-12-10
| | | | Most of files, except for eval.c and eval/* were only processed by perl.
* eval/typval: Add macros useful for hiding list item implementationZyX2017-12-10
|
* eval/typval: Add functions useful for hiding list implementationZyX2017-12-10
|
* ex_getln: Replace global with entry in save_cclineZyX2017-07-17
|
* vim-patch:7.4.1976James McCoy2017-06-04
| | | | | | | Problem: Number variables are not 64 bits while they could be. Solution: Add the num64 feature. (Ken Takata) https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
* unittests: Add a test for TV_CSTRINGZyX2017-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not using enum{} because SIZE_MAX exceeds integer and I do not really like how enum definition is described in C99: 1. Even though all values must fit into the chosen type (6.7.2.2, p 4) the type to choose is still implementation-defined. 2. 6.4.4.3 explicitly states that “an identifier declared as an enumeration constant has type `int`”. So it looks like “no matter what type was chosen for enumeration, constants will be integers”. Yet the following simple program: #include <stdint.h> #include <stdio.h> #include <stddef.h> enum { X=SIZE_MAX }; int main(int argc, char **argv) { printf("x:%zu m:%zu t:%zu v:%zu", sizeof(X), sizeof(SIZE_MAX), sizeof(size_t), (size_t)X); } yields one of the following using different compilers: - clang/gcc/pathcc: `x:8 m:8 t:8 v:18446744073709551615` - pcc/tcc: `x:4 m:8 t:8 v:1844674407370955161` If I remove the cast of X to size_t then pcc/tcc both yield `x:4 m:8 t:8 v:4294967295`, other compilers’ output does not change. All compilers were called with `$compiler -std=c99 -xc -` (feeding program from echo), except for `tcc` which has missing `-std=c99`. `pcc` seems to ignore the argument though: it is perfectly fine with `-std=c1000`.
* eval: Change the point at which arg_errmsg and its length are changedZyX2017-04-14
| | | | Ref #6437
* eval: Use tv_is_func in place of ==VAR_FUNC||==VAR_PARTIALZyX2017-03-29
| | | | Also fixes same error as in vim/vim#1557
* eval: Move part of dictwatcher* functions to eval/typvalZyX2017-03-29
|
* eval/typval: Add missing includes, also add a script to find themZyX2017-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains unfinished attempt to integrate IWYU (ref #549). To finish it different job should be done, specifically: - Instead of feeding IWYU with modified file a mirror source tree should be created with the help of CMake which will contain modified sources. This solves the problem with IWYU thinking that `*.generated.h` headers should be included in place of `*` headers. - Build IWYU as all other third-party utilities. - Make modified sources avoid problems with `nvim/func_attr.h` includes and various related tricks. Current script may only be used for manual checks like this: ./scripts/check-includes.py \ --generated-includes-dir build/include \ --generated-includes-dir build/src/nvim/auto \ --file src/nvim/eval/typval.c \ -- -Isrc -Ibuild/include -Ibuild/src/nvim/auto \ -DINCLUDE_GENERATED_DECLARATIONS (it is also somewhat fine with `--file src/nvim/eval/typval.h`). I have no idea why (I mean, why developer think that these lines are needed, why they are suggested is pretty obvious: because there is typedef which mentions them before structs are defined), but for typval.h it reports, among other things, that it should add lines struct dictvar_S; struct listitem_S; struct listvar_S; struct listwatch_S;
* eval: Fix max_min functionsZyX2017-03-29
| | | | | | Found two bugs: 1. Multiple unneeded error messages, vim/vim#1039. 2. Unformatted error string, vim/vim#1040.