aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
Commit message (Collapse)AuthorAge
...
* vim-patch:8.2.2075: error for const argument to mapnew()zeertzjq2023-08-17
| | | | | | | | | Problem: Error for const argument to mapnew(). Solution: Don't give an error. (closes vim/vim#7400) https://github.com/vim/vim/commit/57cf4973a283941c92744554474b2c52ce892fd1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1971: memory leak when map() failszeertzjq2023-08-17
| | | | | | | | | Problem: Memory leak when map() fails. Solution: Clear the typval. https://github.com/vim/vim/commit/c56936e2ba4fd219f56aab616fcb283132455697 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1969: Vim9: map() may change the list or dict item typezeertzjq2023-08-17
| | | | | | | | | Problem: Vim9: map() may change the list or dict item type. Solution: Add mapnew(). https://github.com/vim/vim/commit/ea696852e7abcdebaf7f17a7f23dc90df1f5e2ed Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(messages): use "Vimscript" instead of "VimL" #24111Justin M. Keyes2023-06-22
| | | | followup to #24109 fix #16150
* vim-patch:8.2.3332: Vim9: cannot assign to range in listzeertzjq2023-06-12
| | | | | | | | | Problem: Vim9: cannot assign to range in list. Solution: Implement overwriting a list range. https://github.com/vim/vim/commit/4f0884d6e24d1d45ec83fd86b372b403177d3298 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3852: Vim9: not enough testszeertzjq2023-06-12
| | | | | | | | | | Problem: Vim9: not enough tests. Solution: Also run existing tests for Vim9 script. Make errors more consistent. https://github.com/vim/vim/commit/f47c5a8e2d8eda7c2c8a9cccf9568eb56c03a0cf 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>
* revert: "refactor: eliminate `autocmd_fname_full` global"zeertzjq2023-06-07
| | | | This reverts commit 82cd0be2eaf71c0476e15c66ba3e83c76896d407.
* 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:9.0.1597: cursor ends up below the window after a put (#23873)zeertzjq2023-06-02
| | | | | | | | | Problem: Cursor ends up below the window after a put. Solution: Mark w_crow and w_botline invalid when changing the cursor line. (closes vim/vim#12465) https://github.com/vim/vim/commit/8509014adda188ee8bdf6a2e123fbf15a91b29d2 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor(api): new helper macrosFamiu Haque2023-05-23
| | | | Adds new API helper macros `CSTR_AS_OBJ()`, `STATIC_CSTR_AS_OBJ()`, and `STATIC_CSTR_TO_OBJ()`, which cleans up a lot of the current code. These macros will also be used extensively in the upcoming option refactor PRs because then API Objects will be used to get/set options. This PR also modifies pre-existing code to use old API helper macros like `CSTR_TO_OBJ()` to make them cleaner.
* refactor(map): avoid duplicated khash_t types for valuesbfredl2023-05-17
| | | | | | | | | | | | | | | | | | | | | This reduces the total number of khash_t instantiations from 22 to 8. Make the khash internal functions take the size of values as a runtime parameter. This is abstracted with typesafe Map containers which are still specialized for both key, value type. Introduce `Set(key)` type for when there is no value. Refactor shada.c to use Map/Set instead of khash directly. This requires `map_ref` operation to be more flexible. Return pointers to both key and value, plus an indicator for new_item. As a bonus, `map_key` is now redundant. Instead of Map(cstr_t, FileMarks), use a pointer map as the FileMarks struct is humongous. Make `event_strings` actually work like an intern pool instead of wtf it was doing before.
* test(old): remove python2 tests (#23547)zeertzjq2023-05-09
| | | Because python2 provider is no longer supported.
* vim-patch:8.2.2459: Coverity reports dead code (#23531)zeertzjq2023-05-08
| | | | | | | | Problem: Coverity reports dead code. Solution: Remove the dead code. https://github.com/vim/vim/commit/8bead9a058907e7f10ad25893d8475d2d9dd173c Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0904: various comment and indent flaws (#23498)zeertzjq2023-05-06
| | | | | | | | | | | Problem: Various comment and indent flaws. Solution: Improve comments and indenting. https://github.com/vim/vim/commit/88456cd3c49a3dd1fda17cf350daa9b8216b1aa6 Omit test_function_lists.vim change as that file is likely not applicable to Nvim due to the existence of Nvim-only functions. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.1508: catch does not work when lines are joined with a newlinezeertzjq2023-05-06
| | | | | | | Problem: Catch does not work when lines are joined with a newline. Solution: Set "nextcmd" appropriately. (closes vim/vim#12348) https://github.com/vim/vim/commit/f2588b6fc90ba85b333ee8f747e8d1ebbc7e6300
* vim-patch:8.2.2141: a user command with try/catch may not catch an ↵zeertzjq2023-05-06
| | | | | | | | | | | expression error Problem: A user command with try/catch may not catch an expression error. Solution: When an expression fails check for following "|". (closes vim/vim#7469) https://github.com/vim/vim/commit/8143a53c533bc7776c57e5db063d185bdd5750f3 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2094: when an expression fails getting next command may be wrongzeertzjq2023-05-06
| | | | | | | | | Problem: When an expression fails getting the next command may be wrong. Solution: Do not check for a next command after :eval fails. (closes vim/vim#7415) https://github.com/vim/vim/commit/d0fe620cbbf5f5e00446efa89893036265c5c302 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>
* vim-patch:8.2.1697: inconsistent capitalization of error messages (#23476)zeertzjq2023-05-04
| | | | | | | | | | Problem: Inconsistent capitalization of error messages. Solution: Always start with a capital. https://github.com/vim/vim/commit/7707228aace9aff16434edf5377a354c6ad07316 Most of these errors are Vim9 script only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2756: Vim9: blob index and slice not implemented yetzeertzjq2023-05-04
| | | | | | | | | Problem: Vim9: blob index and slice not implemented yet. Solution: Implement blob index and slice. https://github.com/vim/vim/commit/cfc3023cb6ce5aaec13f49bc4b821feb05e3fb03 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2344: using inclusive index for slice is not always desiredzeertzjq2023-05-04
| | | | | | | | | | | | Problem: Using inclusive index for slice is not always desired. Solution: Add the slice() method, which has an exclusive index. (closes vim/vim#7408) https://github.com/vim/vim/commit/6601b62943a19d4f8818c3638440663d67a17b6a Cherry-pick a line in docs added later. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1466: Vim9: cannot index or slice a variable with type "any"zeertzjq2023-05-04
| | | | | | | | | | | Problem: Vim9: cannot index or slice a variable with type "any". Solution: Add runtime index and slice. https://github.com/vim/vim/commit/cc673e746ab98566556ff964d7a76f2fb46d7f84 Missing changes from the last PR. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1462: Vim9: string slice not supported yetzeertzjq2023-05-04
| | | | | | | | | Problem: Vim9: string slice not supported yet. Solution: Add support for string slicing. https://github.com/vim/vim/commit/11107bab7ead9124f46a7ddf6aa3bb66b43a8246 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1461: Vim9: string indexes are counted in byteszeertzjq2023-05-04
| | | | | | | | | Problem: Vim9: string indexes are counted in bytes. Solution: Use character indexes. (closes vim/vim#6574) https://github.com/vim/vim/commit/e3c37d8ebf9dbbf210fde4a5fb28eb1f2a492a34 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1466: Vim9: cannot index or slice a variable with type "any"zeertzjq2023-05-04
| | | | | | | | | | | | | Problem: Vim9: cannot index or slice a variable with type "any". Solution: Add runtime index and slice. https://github.com/vim/vim/commit/cc673e746ab98566556ff964d7a76f2fb46d7f84 Omit E1024 and E1062: Vim9 script only. Omit string_slice() and char_idx2byte(): Vim9 script only. Remove the first tv_is_luafunc() check because it always returns false. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1463: Vim9: list slice not supported yetzeertzjq2023-05-04
| | | | | | | | | Problem: Vim9: list slice not supported yet. Solution: Add support for list slicing. https://github.com/vim/vim/commit/ed5918771fcf9877d8445e74c62ab1ce6b8e28c1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.0987: Vim9: cannot assign to [var; var]zeertzjq2023-05-04
| | | | | | | | | Problem: Vim9: cannot assign to [var; var]. Solution: Assign rest of items to a list. https://github.com/vim/vim/commit/9af78769eeae0318e07aa8b6af4d6e2244481ca7 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor: uncrustifydundargoc2023-04-26
| | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
* fix(timer): allow timer_info() to get info about current timerzeertzjq2023-04-25
|
* vim-patch:9.0.0335: checks for Dictionary argument often give a vague error ↵zeertzjq2023-04-25
| | | | | | | | | | | | (#23309) Problem: Checks for Dictionary argument often give a vague error message. Solution: Give a useful error message. (Yegappan Lakshmanan, closes vim/vim#11009) https://github.com/vim/vim/commit/04c4c5746e15884768d2cb41370c3276a196cd4c Cherry-pick removal of E922 from docs from patch 9.0.1403. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* refactor(eval): use tv_list_append_allocated_string()zeertzjq2023-04-19
|
* vim-patch:8.2.4197: cannot use an import in the "expr" part of 'spellsuggest'zeertzjq2023-04-17
| | | | | | | | | Problem: Cannot use an import in the "expr" part of 'spellsuggest'. Solution: Set the script context when evaluating "expr" of 'spellsuggest'. https://github.com/vim/vim/commit/2a7aa834583dea157eccf3e69827d2ff1d9fe9c7 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4193: cannot use an import in 'charconvert'zeertzjq2023-04-17
| | | | | | | | | | Problem: Cannot use an import in 'charconvert'. Solution: Set the script context when evaluating 'charconvert'. Also expand script-local functions in 'charconvert'. https://github.com/vim/vim/commit/f4e88f2152c5975a6f4cfa7ccd745575fe4d1c78 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4186: cannot use an import in 'patchexpr'zeertzjq2023-04-17
| | | | | | | | | | Problem: Cannot use an import in 'patchexpr'. Solution: Set the script context when evaluating 'patchexpr'. Do not require 'patchexpr' to return a bool, it was ignored anyway. https://github.com/vim/vim/commit/36c2add7f82bc5dbbfc45db31953ef9633c635b3 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4182: memory leak when evaluating 'diffexpr'zeertzjq2023-04-17
| | | | | | | | | Problem: Memory leak when evaluating 'diffexpr'. Solution: Use free_tv() instead of clear_tv(). https://github.com/vim/vim/commit/39b8944539a9cde553fe709e535fdfd37d0f9307 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4181: Vim9: cannot use an import in 'diffexpr'zeertzjq2023-04-17
| | | | | | | | | | Problem: Vim9: cannot use an import in 'diffexpr'. Solution: Set the script context when evaluating 'diffexpr'. Do not require 'diffexpr' to return a bool, it was ignored anyway. https://github.com/vim/vim/commit/7b29f6a3949743914f08410b6f6bd6237c2f2038 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.1145: invalid memory access with recursive substitute ↵zeertzjq2023-04-16
| | | | | | | | | | expression (#23132) Problem: Invalid memory access with recursive substitute expression. Solution: Check the return value of vim_regsub(). https://github.com/vim/vim/commit/3ac1d97a1d9353490493d30088256360435f7731 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0398: members of funccall_T are inconsistently named (#23123)zeertzjq2023-04-16
| | | | | | | | Problem: Members of funccall_T are inconsistently named. Solution: Use the "fc_" prefix for all members. https://github.com/vim/vim/commit/ca16c60f337ed33d5dd66a6e90aaf95b619c5e47 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3783: confusing error for using a variable as a functionzeertzjq2023-04-16
| | | | | | | | | | Problem: Confusing error for using a variable as a function. Solution: If a function is not found but there is a variable, give a more useful error. (issue vim/vim#9310) https://github.com/vim/vim/commit/2ef9156b4284e4a52613c36e3d4667245273a28d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2978: warning for uninitialized variablezeertzjq2023-04-16
| | | | | | | | | Problem: Warning for uninitialized variable. Solution: Set return value to FAIL. https://github.com/vim/vim/commit/744aecf8777e86fac6d30f072e90e2de353b8ea1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2977: crash when using a null function referencezeertzjq2023-04-16
| | | | | | | | | Problem: Crash when using a null function reference. (Naohiro Ono) Solution: Check for an invalid function name. (closes vim/vim#8367) https://github.com/vim/vim/commit/22db0d549f64aa3d8a6e366b70eb8d7e66933b82 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2848: crash whn calling partialzeertzjq2023-04-16
| | | | | | | | | Problem: Crash whn calling partial. Solution: Check for NULL pointer. (Dominique Pellé, closes vim/vim#8202) https://github.com/vim/vim/commit/fe8ebdbe5c4e116311c0c0d5937b89ded5c92d01 Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
* refactor: deprecate checkhealth functionsdundargoc2023-04-15
| | | | | | | | | | | | | | | | | | | | | | | The following functions are deprecated and will be removed in Nvim v0.11: - health#report_start() - health#report_info() - health#report_ok() - health#report_warn() - health#report_error() - vim.health.report_start() - vim.health.report_info() - vim.health.report_ok() - vim.health.report_warn() - vim.health.report_error() Users should instead use these: - vim.health.start() - vim.health.info() - vim.health.ok() - vim.health.warn() - vim.health.error()
* vim-patch:9.0.0104: going beyond allocated memory when evaluating string ↵zeertzjq2023-04-15
| | | | | | | | | | | constant Problem: Going beyond allocated memory when evaluating string constant. Solution: Properly skip over <Key> form. https://github.com/vim/vim/commit/1e56bda9048a9625bce6e660938c834c5c15b07d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* 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.1378: cannot put space between function name and parenzeertzjq2023-04-15
| | | | | | | | | | | Problem: Cannot put space between function name and paren. Solution: Allow this for backwards compatibility. https://github.com/vim/vim/commit/bbd3e3c357487f7a5bdc704a819f63a7dd0dd66e This fixes a regression from patch 8.2.1365, which isn't ported yet. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3329: v_lock not set when getting value of environment variablezeertzjq2023-04-15
| | | | | | | | | Problem: v_lock not set when getting value of environment variable. Solution: Set v_lock to zero. https://github.com/vim/vim/commit/16e63e6d353c8b7337470644ceac02dc5e569db9 Co-authored-by: Bram Moolenaar <Bram@vim.org>