aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
Commit message (Collapse)AuthorAge
...
* | vim-patch:8.2.3788: lambda for option that is a function may be freedzeertzjq2022-11-07
| | | | | | | | | | | | | | | | | | | | Problem: Lambda for option that is a function may be garbage collected. Solution: Set a reference in the funcref. (Yegappan Lakshmanan, closes vim/vim#9330) https://github.com/vim/vim/commit/6ae8fae8696623b527c7fb22567f6a3705b2f0dd Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | vim-patch:8.2.3756: might crash when callback is not validzeertzjq2022-11-07
| | | | | | | | | | | | | | | | | | Problem: might crash when callback is not valid. Solution: Check for valid callback. (Yegappan Lakshmanan, closes vim/vim#9293) https://github.com/vim/vim/commit/4dc24eb5adbcc76838fae1e900936dd230209d96 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | vim-patch:8.2.3751: cannot assign a lambda to an option that takes a functionzeertzjq2022-11-07
| | | | | | | | | | | | | | | | | | | | Problem: Cannot assign a lambda to an option that takes a function. Solution: Automatically convert the lambda to a string. (Yegappan Lakshmanan, closes vim/vim#9286) https://github.com/vim/vim/commit/6409553b6e3b4de4e1d72b8ee5445595214581ff Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | feat: ":write ++p" creates parent dirs #20835Victor Blanchard2022-11-06
| | | | | | | | | | | | | | | | | | | | | | - `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if they do not exist - Note: `:foo ++…` is usually for options. No existing options have a single-char abbreviation (presumably by design), so it's safe to special-case `++p` here. - Same for `writefile(…, 'foo/bar/baz.txt', 'p')` - `BufWriteCmd` can see the ++p flag via `v:cmdarg`. closes #19884
* | vim-patch:8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'zeertzjq2022-11-07
| | | | | | | | | | | | | | | | | | | | Problem: Cannot use a lambda for 'completefunc' and 'omnifunc'. Solution: Implement lambda support. (Yegappan Lakshmanan, closes vim/vim#9257) https://github.com/vim/vim/commit/8658c759f05b317707d56e3b65a5ef63930c7498 Comment out Vim9 script in tests. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | vim-patch:8.2.3705: cannot pass a lambda name to function() or funcref()zeertzjq2022-11-07
|/ | | | | | | | | | Problem: Cannot pass a lambda name to function() or funcref(). (Yegappan Lakshmanan) Solution: Handle a lambda name differently. https://github.com/vim/vim/commit/eba3b7f6645c8f856132b4c06a009a3b0a44e21c Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3055: strange error for assigning to "x.key" on non-dictionaryzeertzjq2022-11-06
| | | | | | | | | Problem: Strange error for assigning to "x.key" on non-dictionary. Solution: Add a specific error message. (closes vim/vim#8451) https://github.com/vim/vim/commit/3a3b10e87a10dd0bc355618dbfc4a0a6c828aad7 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor(eval): make get_lval() explicitly check for v:luazeertzjq2022-11-06
| | | | Needed for Vim patch 8.2.3055.
* vim-patch:8.2.2920: still a way to shadow a builtin functionzeertzjq2022-11-06
| | | | | | | | | Problem: Still a way to shadow a builtin function. (Yasuhiro Matsumoto) Solution: Check the key when using extend(). (issue vim/vim#8302) https://github.com/vim/vim/commit/6f1d2aa437744a7cb0206fdaa543a788c5a56c79 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2918: builtin function can be shadowed by global variablezeertzjq2022-11-06
| | | | | | | | | | Problem: Builtin function can be shadowed by global variable. Solution: Check for builtin function before variable. (Yasuhiro Matsumoto, closes vim/vim#8302) https://github.com/vim/vim/commit/3d9c4eefe656ee8bf58c0496a48bd56bac180056 Cherry-pick Test_gettext() from patch 8.2.2886.
* vim-patch:8.2.3016: confusing error when expression is followed by commazeertzjq2022-11-06
| | | | | | | | | | | Problem: Confusing error when expression is followed by comma. Solution: Give a different error for trailing text. (closes vim/vim#8395) https://github.com/vim/vim/commit/fae55a9cb0838e4c2e634e55a3468af4a75fbdf2 Omit test_eval_stuff.vim and test_viminfo.vim: changes tests are N/A. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2722: Vim9: crash when using LHS with double indexzeertzjq2022-11-06
| | | | | | | | | | Problem: Vim9: crash when using LHS with double index. Solution: Handle lhs_dest which is "dest_expr". (closes vim/vim#8068) Fix confusing error message for missing dict item. https://github.com/vim/vim/commit/b9c0cd897ab4ad54f514187e89719c0241393f8b Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1306: checking for first character of dict key is inconsistentzeertzjq2022-11-06
| | | | | | | | | | | Problem: Checking for first character of dict key is inconsistent. Solution: Add eval_isdictc(). (closes vim/vim#6546) https://github.com/vim/vim/commit/b13ab99908097d54e21ab5adad22f4ad2a8ec688 Omit handle_subscript() change: only affects Vim9 script. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1274: Vim9: no error for missing white space at script levelzeertzjq2022-11-06
| | | | | | | | | | | | Problem: Vim9: no error for missing white space in assignment at script level. Solution: Check for white space. (closes vim/vim#6495) https://github.com/vim/vim/commit/63be3d4ba01d565e645d8bf7f4dc900fc9011534 Cherry-pick Test_let_errors() change from patch 8.2.0633. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3919: Vim9: wrong argument for append() results in two errorszeertzjq2022-11-05
| | | | | | | | | | Problem: Vim9: wrong argument for append() results in two errors. Solution: Check did_emsg. Also for setline(). Adjust the help for appendbufline(). https://github.com/vim/vim/commit/8b6256f6ec075cca40341e61ebc9f538b4902dd1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:partial:8.2.1183: assert_fails() checks the last error messagezeertzjq2022-11-05
| | | | | | | | | | | | | | | Problem: assert_fails() checks the last error message. Solution: Check the first error, it is more relevant. Fix all the tests that rely on the old behavior. https://github.com/vim/vim/commit/9b7bf9e98f06ece595fed7a3ff53ecce89797a53 Skip test_listener.vim, test_textprop.vim, test_viminfo.vim. Skip test_python2.vim: affected line fails and hasn't been ported. Skip test_python3.vim: affected lines fail and haven't been ported. Skip CHECK_LIST_MATERIALIZE. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.0615: regexp benchmark stest is old style (#20940)zeertzjq2022-11-05
| | | | | | | | | | Problem: Regexp benchmark stest is old style. Solution: Make it a new style test. Fix using a NULL list. Add more tests. (Yegappan Lakshmanan, closes vim/vim#5963) https://github.com/vim/vim/commit/ad48e6c1590842ab6d48e6caba3e9250734dae27 N/A patches: vim-patch:9.0.0829: wrong counts in macro comment
* docs: fix typosdundargoc2022-11-02
|
* build(lint): remove clint.py rules for braces #20880dundargoc2022-11-01
| | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also https://github.com/neovim/neovim/pull/18563
* vim-patch:8.2.1395: Vim9: no error if declaring a funcref with lower case letterzeertzjq2022-10-28
| | | | | | | | | Problem: Vim9: no error if declaring a funcref with a lower case letter. Solution: Check the name after the type is inferred. Fix confusing name. https://github.com/vim/vim/commit/98b4f145eb89405021e23a4a37db51d60a75a1d0 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4207: recursion test fails with MSVCzeertzjq2022-10-27
| | | | | | | | | Problem: Recursion test fails with MSVC. Solution: Use a smaller limit for MSVC. https://github.com/vim/vim/commit/50e05254450954f04183efc7bc871527a67868b8 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4206: condition with many "(" causes a crashzeertzjq2022-10-27
| | | | | | | | | Problem: Condition with many "(" causes a crash. Solution: Limit recursion to 1000. https://github.com/vim/vim/commit/fe6fb267e6ee5c5da2f41889e4e0e0ac5bf4b89d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1852: map() returing zero for NULL list is unexpectedzeertzjq2022-10-26
| | | | | | | | | Problem: map() returing zero for NULL list is unexpected. Solution: Return the empty list. (closes vim/vim#7133) https://github.com/vim/vim/commit/ffdf8adfa8108d4765fdc68abbd2fe49a4292b25 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.0619: null dict is not handled like an empty dictzeertzjq2022-10-26
| | | | | | | | | Problem: Null dict is not handled like an empty dict. Solution: Fix the code and add tests. (Yegappan Lakshmanan, closes vim/vim#5968) https://github.com/vim/vim/commit/ea04a6e8baff2f27da7cdd54bf70a5525994f76d Nvim doesn't support modifying NULL list, so comment out a line.
* refactor: clang-tidy fixes to silence clangd warning (#20683)dundargoc2022-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | * refactor: readability-uppercase-literal-suffix * refactor: readability-named-parameter * refactor: bugprone-suspicious-string-compare * refactor: google-readability-casting * refactor: readability-redundant-control-flow * refactor: bugprone-too-small-loop-variable * refactor: readability-non-const-parameter * refactor: readability-avoid-const-params-in-decls * refactor: google-readability-todo * refactor: readability-inconsistent-declaration-parameter-name * refactor: bugprone-suspicious-missing-comma * refactor: remove noisy or slow warnings
* vim-patch:9.0.0804: crash when trying to divide a number by -1zeertzjq2022-10-20
| | | | | | Problem: Crash when trying to divice the largest negative number by -1. Solution: Handle this case specifically. https://github.com/vim/vim/commit/cdef1cefa2a440911c727558562f83ed9b00e16b
* refactor: replace char_u with charDundar Göc2022-10-15
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:9.0.0712: wrong column when calling setcursorcharpos() with zero lnumzeertzjq2022-10-10
| | | | | | | Problem: Wrong column when calling setcursorcharpos() with zero lnum. Solution: Set the line number before calling buf_charidx_to_byteidx(). (closes vim/vim#11329) https://github.com/vim/vim/commit/79f234499b6692cc16970b7455bc9b002242632f
* refactor: replace unnecessary helper functions in optionstr.cFamiu Haque2022-09-28
| | | | | | | | | | | | Replaces unnecessary helper functions in `optionstr.c` such as `get_option_flags()`, `get_option_fullname()`, `set_option_flag()`, `is_global_option()`, etc. with a single `get_option()` helper function that allows direct access to the `options` array. Also refactors `f_exists()` to use `get_varp_scope` instead of using `get_option_tv`. This opens up the path for removing `getoptions_T` altogether later down the line since the hidden option logic is no longer needed.
* vim-patch:8.2.3796: the funcexe_T struct members are not named consistently ↵zeertzjq2022-09-16
| | | | | | | | | (#20214) Problem: The funcexe_T struct members are not named consistently. Solution: Prefix "fe_" to all the members. https://github.com/vim/vim/commit/851f86b951cdd67ad9cf3149e46169d1375c8d82 Omit fe_check_type: always NULL in legacy Vim script.
* refactor: replace char_u with charDundar Göc2022-09-11
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-09-10
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-09-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:9.0.0409: #{g:x} was seen as a curly-braces expressionii142022-09-08
| | | | | | Problem: #{g:x} was seen as a curly-braces expression. Solution: Do never see #{} as a curly-braces expression. (closes vim/vim#11075) https://github.com/vim/vim/commit/7c7e1e9b98d4e5dbe7358c795a635c6f1f36f418
* vim-patch:8.2.3702: first key in dict is seen as curly expression and failszeertzjq2022-09-08
| | | | | | Problem: First key in dict is seen as curly expression and fails. Solution: Ignore failure of curly expression. (closes vim/vim#9247) https://github.com/vim/vim/commit/98cb90ef865089a5ddd20bc0303d449fb7d97fb2
* refactor: replace char_u with charDundar Göc2022-09-06
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-09-01
| | | | Work on https://github.com/neovim/neovim/issues/459
* Merge pull request #20022 from dundargoc/refactor/char_u/6bfredl2022-09-01
|\ | | | | refactor: replace char_u with char 6
| * refactor: replace char_u with charDundar Göc2022-08-31
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
* | Merge pull request #16396 from bfredl/luaeventbfredl2022-08-31
|\ \ | |/ |/| feat(lua): vim.ui_attach to get ui events from lua
| * feat(lua): vim.ui_attach to get ui events from luabfredl2022-08-31
| | | | | | | | Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
* | refactor: replace char_u with charDundar Göc2022-08-31
|/ | | | Work on https://github.com/neovim/neovim/issues/459
* fix(exceptions): restore `did_throw` (#20000)Sean Dewar2022-08-30
| | | | | | | | | | | | | | | | | | `!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false` is sometimes used to defer exception handling for later (without forgetting the exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred to a different call (e.g: when `try_level > 0`). In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of `did_throw = false`, but also causes the pending exception to be lost, which also leaks as `discard_exception()` wasn't used. It may be possible to fix this by saving/restoring `current_exception`, but handling all of `did_throw`'s edge cases seems messier. Maybe not worth diverging over. This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown due to Windows missing `man`, but they're lost; skip these tests if `man` isn't executable.
* refactor: replace char_u with char 4 (#19987)dundargoc2022-08-30
| | | | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-08-29
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:8.2.1269: language and locale code spread out (#19964)zeertzjq2022-08-27
| | | | | | | | Problem: Language and locale code spread out. Solution: Move relevant code to src/locale.c. (Yegappan Lakshmanan, closes vim/vim#6509) https://github.com/vim/vim/commit/054f14bbe58fece17f1a74ca63f0b37518f0b4de Also remove redundant <locale.h> includes.
* refactor: replace char_u with charDundar Göc2022-08-26
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: change FALSE/TRUE to false/trueLewis Russell2022-08-26
| | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor: replace char_u with charDundar Goc2022-08-25
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: suppress clang and PVS warnings (#19940)zeertzjq2022-08-25
|