aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
Commit message (Collapse)AuthorAge
...
| * 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
* | Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2022-10-11
|\|
| * 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
| |
| * Merge pull request #19906 from bfredl/bigstagebfredl2022-08-24
| |\ | | | | | | perf(api): allow to use an arena for return values
| | * perf(api): allow to use an arena for return valuesbfredl2022-08-23
| | |
| * | feat(eval)!: make Vim functions return inner window width and height (#19743)zeertzjq2022-08-24
| |/ | | | | | | | | | | | | | | | | In non-multigrid UI the only change is that the returned height now excludes winbar, and this is compatible with Vim. In multigrid UI this means the return value of these functions now reflect the space available for buffer lines in a window. No change in nvim_win_get_height() and nvim_win_get_width().
| * vim-patch:8.2.4753: error from setting an option is silently ignored (#19888)zeertzjq2022-08-22
| | | | | | | | | | Problem: Error from setting an option is silently ignored. Solution: Handle option value errors better. Fix uses of N_(). https://github.com/vim/vim/commit/31e5c60a682840959cae6273ccadd9aae48c928d
| * vim-patch:8.2.2289: Vim9: 'cpo' can become empty (#19887)zeertzjq2022-08-22
| | | | | | | | | | | | | | | | Problem: Vim9: 'cpo' can become empty. Solution: Use empty_option instead of an empty string. Update quickfix buffer after restoring 'cpo'. (closes vim/vim#7608) https://github.com/vim/vim/commit/e5a2dc87fd9d63dfd0d9c379e363ee8b8c05b14c Omit test as it is Vim9 script.
* | feat(userreg): Add user-defined registers to Neovim.Josh Rahm2022-08-21
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change unlocks additional registers for Neovim by allowing a user to define their own behavior for non-builtin registers. This is accopmlished through a new option 'userregfunc' The 'userregfunc' defines the function to call when handling a register for which there is no builtin functionality. The 'userregfunc' function should take 3 arguments: action - Either "yank" or "put" register - The character corresponding to the register content - In the case of action == "yank", the dictionary describing the yanked content, with the following keys: {type} - Either "char", "line" or "block" {lines} - The lines being yanked as a list {width} - The width in case of "block" mode. {additional_data} - Additional data (can be returned in "put" mode) In case of "put" this function should return the content to put. This content can be either: * A dictionary in the same template as content above. * A list of strings. This will be assumed to be "line" mode. * A string. This will be assumed to be "char" mode. An example of a "null" 'userregfunc' that provides an implementation identical to traditional vim registers would be: let s:contents = {} function! MyUserregFunction(action, register, content) abort if a:action == "put" return get(s:contents, a:register, "") else let s:contents[a:register] = a:content endif endfunction set userregfun=MyUserregFunction It is important to note that any valid unicode character can now be a register, including something like @☺. This change also addresses the multibyte parsing issues surrounding let @a = 'xyz' let @🔨 = 'hammer'
* vim-patch:8.1.1886: command line expansion code is spread out (#19861)zeertzjq2022-08-21
| | | | | Problem: Command line expansion code is spread out. Solution: Move the code to cmdexpand.c. (Yegappan Lakshmanan, closes vim/vim#4831) https://github.com/vim/vim/commit/66b51420e0c8d49bcf6786b792c938d6099e3393
* vim-patch:8.1.2045: the option.c file is too big (#19854)zeertzjq2022-08-20
| | | | | | | | | | | Problem: The option.c file is too big. Solution: Split off the code dealing with strings. (Yegappan Lakshmanan, closes vim/vim#4937) https://github.com/vim/vim/commit/dac1347b4d9c1a1aef6aa73fdea08a9d1077d6ea Cherry-pick set_string_option_direct_in_win() from patch 8.1.1405. Cherry-pick shift_line() comment change from patch 8.1.2096. Move 'clipboard' default parsing to didset_string_options(). Reorder option flags to put Nvim-only flags at the end.