aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/vars.c
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'upstream/master' into userreguserregJosh Rahm2023-11-29
|\
| * refactor: fix headers with IWYUdundargoc2023-11-28
| |
| * refactor: rename types.h to types_defs.hdundargoc2023-11-27
| |
| * build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
| |
| * build: rework IWYU mapping filesdundargoc2023-11-25
| | | | | | | | | | Create mapping to most of the C spec and some POSIX specific functions. This is more robust than relying files shipped with IWYU.
| * refactor: iwyu (#26062)zeertzjq2023-11-16
| |
| * build: remove PVSdundargoc2023-11-12
| | | | | | | | | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
| * refactor: change some xstrndup() and xstrnsave() to xmemdupz() (#25959)zeertzjq2023-11-10
| | | | | | | | When the given length is exactly the number of bytes to copy, xmemdupz() makes the intention clearer.
| * refactor: the long goodbyedundargoc2023-11-05
| | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
| * refactor(options)!: make OptionSet `v:` values use typvalFamiu Haque2023-10-17
| | | | | | | | BREAKING CHANGE: This breaks the OptionSet autocommand, as the `v:` values associated with it (`v:option_new`, `v:option_old`, `v:option_oldlocal` and `v:option_oldglobal`) are now the same type as the option, instead of all option values being converted to strings.
| * refactor(options): unify set_num_option and set_bool_optionFamiu Haque2023-10-17
| |
| * refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | | | | | | | - Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
| * build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
| |
| * refactor(message): msg_puts_attr_len -> msg_puts_lenbfredl2023-09-29
| |
| * refactor: remove longdundargoc2023-09-29
| | | | | | | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
| * refactor(messages): fold msg_attr into msgbfredl2023-09-27
| | | | | | | | | | problem: there are too many different functions in message.c solution: fold some of the functions into themselves
| * refactor(messages): fold msg_outtrans_attr into msg_outtransbfredl2023-09-27
| | | | | | | | | | problem: there are too many different functions in message.c solution: fold some of the functions into themselves
| * fix(api, lua): handle setting v: variables properly (#25325)zeertzjq2023-09-24
| |
| * docs: fix typos and other small fixes (#25005)dundargoc2023-09-14
| | | | | | | | | | | | | | Co-authored-by: nuid64 <lvkuzvesov@proton.me> Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com> Co-authored-by: XTY <xty@xty.io> Co-authored-by: Empa <emanuel@empa.xyz> Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
| * fix(:let): fix error when applying operator to boolean option (#24030)zeertzjq2023-06-15
| |
| * vim-patch:9.0.1631: passing wrong variable type to option gives multiple ↵zeertzjq2023-06-15
| | | | | | | | | | | | | | | | errors (#24026) Problem: Passing a wrong variable type to an option gives multiple errors. Solution: Bail out early on failure. (closes vim/vim#12504) https://github.com/vim/vim/commit/4c7cb372c17a84c8a35254d93eb37cb854cd39da
| * vim-patch:8.2.4600: Vim9: not enough test coverage for executing :def ↵zeertzjq2023-06-12
| | | | | | | | | | | | | | | | | | | | | | | | function (#24001) Problem: Vim9: not enough test coverage for executing :def function. Solution: Add a few more tests. Fix inconsistencies. https://github.com/vim/vim/commit/6b8c7ba062ca4b50e8f983e0485be7afa4eef691 Cherry-pick a blank line in test_listdict.vim from patch 8.2.3842. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.2533: Vim9: cannot use a range with :unletzeertzjq2023-06-12
| | | | | | | | | | | | | | | | | | Problem: Vim9: cannot use a range with :unlet. Solution: Implement ISN_UNLETRANGE. https://github.com/vim/vim/commit/5b5ae29bd3d7b832b6f15320430f7f191e0abd1f Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor(options): remove `getoption_T` and introduce `OptVal` (#23850)Famiu Haque2023-06-07
| | | | | | | | | | | | | | | | Removes the `getoption_T` struct and also introduces the `OptVal` struct to unify the methods of getting/setting different option value types. This is the first of many PRs to reduce code duplication in the Vim option code as well as to make options easier to maintain. It also increases the flexibility and extensibility of options. Which opens the door for things like Array and Dictionary options.
| * vim-patch:8.2.3689: ex_let_one() is too long (#23830)zeertzjq2023-05-30
| | | | | | | | | | | | | | | | Problem: ex_let_one() is too long. Solution: Split into multiple functions. https://github.com/vim/vim/commit/3ccb5795168793e1b119a028da4035f77cef9f69 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.4890: inconsistent capitalization in error messageszeertzjq2023-05-05
| | | | | | | | | | | | | | | | | | Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * fix(heredoc): allow missing end marker for scriptszeertzjq2023-04-29
| | | | | | | | Also do not crash when getting heredoc fails.
| * vim-patch:8.2.0672: heredoc in scripts does not accept lower case markerzeertzjq2023-04-29
| | | | | | | | | | | | | | | | Problem: Heredoc in scripts does not accept lower case marker. Solution: Allow lower case only in non-Vim scripts. (Ken Takata, closes vim/vim#6019) https://github.com/vim/vim/commit/6ab0953fefe31fef91e40752a675ceb60fc2fe03
| * vim-patch:8.2.0578: heredoc for interfaces does not support "trim"zeertzjq2023-04-29
| | | | | | | | | | | | | | | | Problem: Heredoc for interfaces does not support "trim". Solution: Update the script heredoc support to be same as the :let command. (Yegappan Lakshmanan, closes vim/vim#5916) https://github.com/vim/vim/commit/6c2b7b8055b96463f78abb70f58c4c6d6d4b9d55
| * refactor: uncrustifydundargoc2023-04-26
| | | | | | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
| * vim-patch:8.2.4934: string interpolation fails when not evaluatingzeertzjq2023-04-15
| | | | | | | | | | | | | | | | | | Problem: String interpolation fails when not evaluating. Solution: Skip the expression when not evaluating. (closes vim/vim#10398) https://github.com/vim/vim/commit/70c41241c2701f26a99085e433925a206ca265a3 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.4930: interpolated string expression requires escapingzeertzjq2023-04-15
| | | | | | | | | | | | | | | | | | Problem: Interpolated string expression requires escaping. Solution: Do not require escaping in the expression. https://github.com/vim/vim/commit/0abc2871c105882ed1c1effb9a7757fad8a395bd Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.4883: string interpolation only works in heredoczeertzjq2023-04-15
| | | | | | | | | | | | | | | | | | | | | | | | Problem: String interpolation only works in heredoc. Solution: Support interpolated strings. Use syntax for heredoc consistent with strings, similar to C#. (closes vim/vim#10327) https://github.com/vim/vim/commit/2eaef106e4a7fc9dc74a7e672b5f550ec1f9786e Cherry-pick Test_Debugger_breakadd_expr() from Vim. Co-authored-by: LemonBoy <thatlemon@gmail.com>
| * vim-patch:8.2.4840: heredoc expression evaluated even when skippingzeertzjq2023-04-15
| | | | | | | | | | | | | | | | | | Problem: Heredoc expression evaluated even when skipping. Solution: Don't evaluate when "skip" is set. (closes vim/vim#10306) https://github.com/vim/vim/commit/05c7f5d3d03440da6f69604f8c06c4e3d90d2a26 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.4783: Coverity warns for leaking memoryzeertzjq2023-04-15
| | | | | | | | | | | | | | | | | | Problem: Coverity warns for leaking memory. Solution: Use another strategy freeing "theline". https://github.com/vim/vim/commit/42ccb8d74700506936567b0eb6d11def5e25e1dd Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.4770: cannot easily mix expression and heredoczeertzjq2023-04-15
| | | | | | | | | | | | | | | | | | Problem: Cannot easily mix expression and heredoc. Solution: Support in heredoc. (Yegappan Lakshmanan, closes vim/vim#10138) https://github.com/vim/vim/commit/efbfa867a146fcd93fdec2435597aa4ae7f1325c Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
| * vim-patch:8.2.1111: inconsistent naming of get_list_tv() and eval_dict() ↵zeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | (#23086) Problem: Inconsistent naming of get_list_tv() and eval_dict(). Solution: Rename get_list_tv() to eval_list(). Similarly for eval_number(), eval_string(), eval_lit_string() and a few others. https://github.com/vim/vim/commit/9a78e6df17033223ebdf499f2b02b2538601c52d Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.3216: Vim9: crash when using variable in a loop at script levelzeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: crash when using variable in a loop at script level. Solution: Do not clear the variable if a function was defined. Do not create a new entry in sn_var_vals every time. (closes vim/vim#8628) https://github.com/vim/vim/commit/2eb6fc3b52148f961e804ec2be361d531ff770d8 Omit eval_cstack: Vim9 script only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.1079: Vim9: no line break allowed in a while loopzeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: no line break allowed in a while loop. Solution: Update stored loop lines when finding line breaks. https://github.com/vim/vim/commit/d5053d015a957b343ad9c9e45e0abd2978f10cf0 Omit getline_peek(): Vim9 script only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.1076: Vim9: no line break allowed in :if expressionzeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | Problem: Vim9: no line break allowed in :if expression. Solution: Skip linebreak. https://github.com/vim/vim/commit/faf8626b79e380fe81e7ae2439a535ed7619d27b Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.1071: Vim9: no line break allowed inside a lambdazeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: no line break allowed inside a lambda. Solution: Handle line break inside a lambda in Vim9 script. https://github.com/vim/vim/commit/e40fbc2ca9fda07332a4da5af1fcaba91bed865b Omit skip_expr_concatenate(). Apply the change to skip_expr() instead. Omit eval_ga: Vim9 script only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.1447: condition is always truezeertzjq2023-04-14
| | | | | | | | | | | | | | Problem: Condition is always true. Solution: Remove the useless condition. (closes vim/vim#12253) https://github.com/vim/vim/commit/474891bc89e657100bd37c29129451a0e601879d
| * vim-patch:8.2.1049: Vim9: leaking memory when using continuation linezeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: leaking memory when using continuation line. Solution: Keep a pointer to the continuation line in evalarg_T. Centralize checking for a next command. https://github.com/vim/vim/commit/b171fb179053fa631fec74911b5fb9374cb6a8a1 Omit eval_next_line(): Vim9 script only. vim-patch:8.2.1050: missing change in struct Problem: Missing change in struct. Solution: Add missing change. https://github.com/vim/vim/commit/65a8ed37f7bc61fbe5c612a7b0eb0dfc16ad3e11 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.1047: Vim9: script cannot use line continuation like :def functionzeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: script cannot use line continuation like in a :def function. Solution: Pass the getline function pointer to the eval() functions. Use it for addition and multiplication operators. https://github.com/vim/vim/commit/5409f5d8c95007216ae1190565a7a8ee9ebd7100 Omit source_nextline() and eval_next_non_blank(): Vim9 script only. N/A patches for version.c: vim-patch:8.2.1048: build failure without the eval feature Problem: Build failure without the eval feature. Solution: Add dummy typedef. https://github.com/vim/vim/commit/9d40c63c7dc8c3eb3886c58dcd334bc7f37eceba vim-patch:8.2.1052: build failure with older compilers Problem: Build failure with older compilers. Solution: Move declaration to start of block. https://github.com/vim/vim/commit/7acde51832f383f9a6d2e740cd0420b433ea841a Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.{0695,0725,0734,0753,0818,0819,0822} (#23075)zeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:8.2.0695: Vim9: cannot define a function inside a function Problem: Vim9: cannot define a function inside a function. Solution: Initial support for :def inside :def. https://github.com/vim/vim/commit/04b12697838b232b8b17c553ccc74cf1f1bdb81c vim-patch:8.2.0725: Vim9: cannot call a function declared later in Vim9 script Problem: Vim9: cannot call a function declared later in Vim9 script. Solution: Make two passes through the script file. https://github.com/vim/vim/commit/09689a02840be40fa7bb10b1921fb5bc5b2908f1 vim-patch:8.2.0734: Vim9: leaking memory when using :finish Problem: Vim9: leaking memory when using :finish. Solution: Do not check for next line in third pass. https://github.com/vim/vim/commit/04816717dfea6e2469ff4c9d40f68b59aaf03724 vim-patch:8.2.0753: Vim9: expressions are evaluated in the discovery phase Problem: Vim9: expressions are evaluated in the discovery phase. Solution: Bail out if an expression is not a constant. Require a type for declared constants. https://github.com/vim/vim/commit/32e351179eacfc84f64cd5029e221582d400bb38 vim-patch:8.2.0818: Vim9: using a discovery phase doesn't work well Problem: Vim9: using a discovery phase doesn't work well. Solution: Remove the discovery phase, instead compile a function only when it is used. Add :defcompile to compile def functions earlier. https://github.com/vim/vim/commit/822ba24743af9ee1b5e7f656a7a61a38f3638bca vim-patch:8.2.0819: compiler warning for unused variable Problem: Compiler warning for unused variable. Solution: Remove the variable. https://github.com/vim/vim/commit/f40e51a880a95f94dbbbecc9476559506c2cc345 vim-patch:8.2.0822: Vim9: code left over from discovery phase Problem: Vim9: code left over from discovery phase. Solution: Remove the dead code. https://github.com/vim/vim/commit/2eec37926db6d31beb36f162ac00357a30c093c8 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * fix(eval): prevent double-free in garbage collection (#22990)zeertzjq2023-04-10
| |
| * refactor: remove redundant castsii142023-04-07
| |
| * refactor: remove redundant castsii142023-04-07
| |
| * refactor: remove redundant const char * castsii142023-04-07
| |
| * refactor: make char * parameters const in message.cii142023-04-07
| | | | | | | | Add const to char * parameters in message.c functions and remove some redundant casts.