aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
Commit message (Collapse)AuthorAge
* refactor: reformat with uncrustify #15736dundargoc2021-09-20
| | | | * fix function parameter comments * remove space after star in function names
* refactor: format with uncrustify #15722dundargoc2021-09-19
|
* vim-patch:8.1.1071: cannot get composing characters from the screenzeertzjq2021-09-19
| | | | | | | Problem: Cannot get composing characters from the screen. Solution: Add screenchars() and screenstring(). (partly by Ozaki Kiichi, closes vim/vim#4059) https://github.com/vim/vim/commit/2912abb3a2fd72074e3901c8ae1d4a77ce764675
* refactor: format #15702dundargoc2021-09-18
|
* vim-patch:8.2.3360: user function completion fails with dict functionSean Dewar2021-09-17
| | | | | | | | Problem: User function completion fails with dict function. Solution: Do not stop sequencing through the list if user functions when encountering an empty name. (Naohiro Ono, closes vim/vim#8765, closes vim/vim#8774) https://github.com/vim/vim/commit/5aec755b678cfd434b8ea2158d06992f33e1ff80
* vim-patch:8.2.3337: completing "call g:" returns entries with just "g:"Sean Dewar2021-09-17
| | | | | | Problem: Completing "call g:" returns entries with just "g:". (Naohiro Ono) Solution: Skip empty strings returned by get_user_func_name(). (closes vim/vim#8753) https://github.com/vim/vim/commit/069f90852f1444cac50491c10dfbd339a3f9e0c8
* Merge pull request #15211 from seandewar/blob-portJan Edmund Lazo2021-09-16
|\ | | | | Port VimL's Blob type - vim-patch:8.1.{0735,0736,0738,0741,0742,0755,0756,0757,0765,0793,0797,0798,0802,1022,1023,1671},8.2.{0121,0184,0404,0521,0829,1473,1866,2712}
| * vim-patch:8.2.1866: Vim9: appending to pushed blob gives wrong resultSean Dewar2021-09-16
| | | | | | | | | | | | | | | | Problem: Vim9: appending to pushed blob gives wrong result. Solution: Set ga_maxlen when copying a blob. https://github.com/vim/vim/commit/66fa5fd54f550c0790d36c20124c49493b323bfa Vim9script is N/A.
| * feat(f_msgpackparse): support parsing from BlobSean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | Note that it is not possible for msgpack_unpack_next() and msgpack_unpacker_next() to return MSGPACK_UNPACK_EXTRA_BYTES, so it should be fine to abort() on that. Lua 5.1 doesn't support string hex escapes (\xXX) like VimL does (though LuaJIT does), so convert them to decimal escapes (\DDD) in tests.
| * feat(f_msgpackdump): support dumping to BlobSean Dewar2021-09-16
| |
| * feat(f_chansend): support Blob data argumentSean Dewar2021-09-16
| |
| * fix(eval): partially port v8.2.3284Sean Dewar2021-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | These were issues that I found while porting that I fixed upstream. :^) Very little of the patch can be exactly ported as we're a bit behind on dependant patches (we also can't use the exact :for emsg, as we don't support iterating over Strings yet), so just translate the fixes as best as we can for now. Include latest relevant doc changes from: - v8.1.0815 - v8.2.2658
| * fix(f_remove): partially port v8.2.2779Sean Dewar2021-09-16
| | | | | | | | | | | | | | Fixes remove() copying one extra byte after the end of a Blob's buffer. Can't be fully ported as the change is from blob_remove(), which hasn't been ported yet.
| * vim-patch:8.2.1473: items in a list given to :const can still be modifiedSean Dewar2021-09-16
| | | | | | | | | | | | | | Problem: Items in a list given to :const can still be modified. Solution: Work like ":lockvar! name" but don't lock referenced items. Make locking a blob work. https://github.com/vim/vim/commit/021bda56710d98c09a6b35610a476ab2dd8c58ad
| * fix(f_insert): partially port v8.2.0634Sean Dewar2021-09-15
| | | | | | | | | | Fixes a crash in f_insert() when inserting into a NULL blob. Include blob-related test changes and some other simple changes.
| * vim-patch:8.2.0521: crash when reading a blob failsSean Dewar2021-09-15
| | | | | | | | | | | | | | Problem: Crash when reading a blob fails. Solution: Avoid keeping a pointer to a freed blob object. (Dominique Pelle, closes vim/vim#5890) Adjust error messages. https://github.com/vim/vim/commit/15352dc6ec43fd50cc3be4f4fd1ad74d5619da20
| * vim-patch:8.2.0404: writefile() error does not give a hintSean Dewar2021-09-15
| | | | | | | | | | | | Problem: Writefile() error does not give a hint. Solution: Add remark about first argument. https://github.com/vim/vim/commit/18a2b87ca27c378a555b20f14a284d2ce3511427
| * vim-patch:8.1.1671: copying a blob may result in it being lockedSean Dewar2021-09-15
| | | | | | | | | | | | Problem: Copying a blob may result in it being locked. Solution: Reset v_lock. (Ken Takata, closes vim/vim#4648) https://github.com/vim/vim/commit/b7b9efbccfe17ee3f7b1bb877b7745d5bfbf0804
| * vim-patch:8.1.0802: negative index doesn't work for BlobSean Dewar2021-09-15
| | | | | | | | | | | | | | | | Problem: Negative index doesn't work for Blob. Solution: Make it work, add a test. (closes vim/vim#3856) https://github.com/vim/vim/commit/a5be9b62480a6f338a72c01e57c9edd0bca8048b Leave tv_blob_get()'s return type untouched.
| * vim-patch:8.1.0798: changing a blob while iterating over it works strangelySean Dewar2021-09-15
| | | | | | | | | | | | Problem: Changing a blob while iterating over it works strangely. Solution: Make a copy of the Blob before iterating. https://github.com/vim/vim/commit/dd29ea18050284526174b5685781469240f5bc4a
| * vim-patch:8.1.0797: error E898 is used twiceSean Dewar2021-09-15
| | | | | | | | | | | | Problem: Error E898 is used twice. Solution: Rename the Blob error to E899. (closes vim/vim#3853) https://github.com/vim/vim/commit/bf821bccf18453b01d25bee53e4954b02a5dd0e6
| * vim-patch:8.1.0793: incorrect error messages for functions that take a BlobSean Dewar2021-09-15
| | | | | | | | | | | | | | Problem: Incorrect error messages for functions that now take a Blob argument. Solution: Adjust the error messages. (Dominique Pelle, closes vim/vim#3846) https://github.com/vim/vim/commit/0d17f0d1c09fa6db306336695ba646c21ea24909
| * vim-patch:8.1.0765: string format of a Blob can't be parsed backSean Dewar2021-09-15
| | | | | | | | | | | | Problem: String format of a Blob can't be parsed back. Solution: Use 0z format. https://github.com/vim/vim/commit/4131fd5509b283e978e8c6161f09643b64719787
| * vim-patch:8.1.0755: error message for get() on a Blob with invalid indexSean Dewar2021-09-15
| | | | | | | | | | | | Problem: Error message for get() on a Blob with invalid index. Solution: Return an empty Blob, like get() on a List does. https://github.com/vim/vim/commit/2ea773b468a1143214c2f12b91ab5e1e7abb4a14
| * vim-patch:8.1.0742: not all Blob operations are testedSean Dewar2021-09-15
| | | | | | | | | | | | | | | | Problem: Not all Blob operations are tested. Solution: Add more testing for Blob. https://github.com/vim/vim/commit/05500ece6282407f9f7227aaf564e24147326863 Test_readfile_binary is already ported.
| * feat(decode_string): decode binary string with NULs to BlobSean Dewar2021-09-15
| | | | | | | | | | | | | | | | Strings that previously decoded into a msgpack special for representing BINs with NULs now convert to Blobs. It shouldn't be possible to decode into this special anymore after this change? Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
| * feat(msgpack): convert Blobs to BIN stringsSean Dewar2021-09-15
| |
| * feat(json): convert Blobs to array of byte valuesSean Dewar2021-09-15
| | | | | | | | | | Similiar to how Vim does it, but to be consistent with how Nvim encodes lists, add a space after every comma.
| * vim-patch:8.1.0736: code for Blob not sufficiently testedSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | Problem: Code for Blob not sufficiently tested. Solution: Add more tests. Fix uncovered crash. Add test_null_blob(). https://github.com/vim/vim/commit/c0f5a78c15b194f23bedb82e6825e34f481e6532 eval0 and ex_echo's emsg-specific changes have already been ported. These tests uncover another crash that was fixed in v8.1.0738.
| * 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
* | fix(eval): add the vimscript-1 feature to has()Sean Dewar2021-09-16
|/ | | | | Include Test_string_concat_scriptversion1 to test that has('vimscript-1') works (excluding the :scriptversion 1 bit).
* vim-patch:8.1.1195: Vim script debugger functionality needs cleanupSean Dewar2021-09-13
| | | | | | | | | | | Problem: Vim script debugger functionality needs cleanup. Solution: Move debugger code to a separate file. Add more tests. (Yegappan Lakshmanan, closes vim/vim#4285) https://github.com/vim/vim/commit/eead75c5e8e1f965548c55ee3a9388b2cb3afc36 Good to have for eval_expr_restore in v8.2.3417. Doesn't actually add any tests.
* refactor: replace TRUE/FALSE with true/false #15647dundargoc2021-09-13
|
* vim-patch:8.2.0886: cannot use octal numbers in scriptversion 4Sean Dewar2021-09-11
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot use octal numbers in scriptversion 4. Solution: Add the "0o" notation. (Ken Takata, closes vim/vim#5304) https://github.com/vim/vim/commit/c17e66c5c0acd5038f1eb3d7b3049b64bb6ea30b :scriptversion is N/A. Cherry-pick latest str2nr() doc changes from v8.1.2035. Cherry-pick various mentions of the 0o prefix from: - v8.2.2324 - https://github.com/vim/vim/commit/2346a6378483c9871016f9fc821ec5cbea638f13 - https://github.com/vim/vim/commit/11e3c5ba820325b69cb56f70e13c21d7b8808d33 - https://github.com/vim/vim/commit/82be4849eed0b8fbee45bc8da99b685ec89af59a Patch used ascii_isbdigit() by mistake, which was fixed in v8.2.2309. Make STR2NR_OOCT work the same as STR2NR_OCT when forcing. In Vim, STR2NR_FORCE | STR2NR_OOCT isn't handled, and doesn't actually force anything. Rather than abort(), make it work as STR2NR_OCT. This means STR2NR_FORCE | STR2NR_OCT works the same as STR2NR_FORCE | STR2NR_OOCT and STR2NR_FORCE | STR2NR_OCT | STR2NR_OOCT.
* vim-patch:8.1.2035: recognizing octal numbers is confusingSean Dewar2021-09-11
| | | | | | | | | | | | | | Problem: Recognizing octal numbers is confusing. Solution: Introduce scriptversion 4: do not use octal and allow for single quote inside numbers. https://github.com/vim/vim/commit/60a8de28d11595f4df0419ece8afa7d6accc9fbd :scriptversion is N/A. Cherry-pick Test_readfile_binary() from v8.1.0742. Note that this patch was missing vim_str2nr() changes, and so fails the tests; this was fixed in v8.1.2036.
* vim-patch:8.1.1355: obvious mistakes are accepted as valid expressionsSean Dewar2021-09-11
| | | | | | | | | Problem: Obvious mistakes are accepted as valid expressions. Solution: Be more strict about parsing numbers. (Yasuhiro Matsumoto, closes vim/vim#3981) https://github.com/vim/vim/commit/16e9b85113e0b354ece1cb4f5fcc7866850f3685 Update vim_str2nr_spec.lua to add more tests that use strict = true.
* fix(jobwait): always drain process event queues #15402Gregory Anders2021-08-31
| | | | | | | | | | | | | | Problem: jobwait() returns early if the job was stopped, but the job might have pending callbacks on its event queue which are required to complete its teardown. State such as term->closed might not be updated yet (by the pending callbacks), so codepaths such as :bdelete think the job is still running. Solution: Always flush the job's event queue before returning from jobwait(). ref #15349
* feat(v:lua): support calling v:lua as a methodSean Dewar2021-08-13
|
* fix(v:lua): fix emsg when calling v:lua directlySean Dewar2021-08-12
| | | | | | | | | | v:lua expressions are represented using vvlua_partial. As v:lua isn't intended to be called directly, it's given an empty pt_name. Because of this, calling v:lua directly like "v:lua()" will cause "E117: Unknown function: ", with an empty name. Instead, have call_func() show the name "v:lua" in the emsg.
* vim-patch:8.1.1878: negative float before method not parsed correctlySean Dewar2021-08-12
| | | | | | Problem: Negative float before method not parsed correctly. Solution: Apply "!" and "-" in front of expression before using ->. https://github.com/vim/vim/commit/9cfe8f6e68de4bfb5942d84f4465de914a747b3f
* vim-patch:8.1.1863: confusing error when using a builtin function as methodSean Dewar2021-08-12
| | | | | | | Problem: Confusing error when using a builtin function as method while it does not support that. Solution: Add a specific error message. https://github.com/vim/vim/commit/9174639a82799011cfa0013cbc4c4709b3833bf0
* vim-patch:8.1.1820: using expr->FuncRef() does not workSean Dewar2021-08-12
| | | | | | Problem: Using expr->FuncRef() does not work. Solution: Make FuncRef work as a method. https://github.com/vim/vim/commit/761fdf01c6e307c448cec2684f8b315ba6d1f454
* vim-patch:8.1.1816: cannot use a user defined function as a methodSean Dewar2021-08-12
| | | | | | | Problem: Cannot use a user defined function as a method. Solution: Pass the base as the first argument to the user defined function after "->". (partly by FUJIWARA Takuya) https://github.com/vim/vim/commit/fcfe1a9b8950b8b211ab3b24d84b17c6847ea43f
* vim-patch:8.1.1807: more functions can be used as a methodSean Dewar2021-08-12
| | | | | | | | | Problem: More functions can be used as a method. Solution: Add append(), appendbufline(), assert_equal(), etc. Also add the :eval command. https://github.com/vim/vim/commit/25e42231d3ee27feec2568fa4be2aa2bfba82ae5 :eval is already ported.
* vim-patch:8.1.1803: all builtin functions are globalSean Dewar2021-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: All builtin functions are global. Solution: Add the method call operator ->. Implemented for a limited number of functions. https://github.com/vim/vim/commit/ac92e25a33c37ec5becbfffeccda136c73b761ac - Note that to *exactly* port hunk @@ -7376,18 +7444,19 from handle_subscript(), we need the :scriptversion patches (I have an open PR for those, but this patch works fine without them anyway). - Port call_internal_func() from v7.4.2058. - Adjust some error messages in tests, as they rely on the Blob patches. - Add a modeline to test_method.vim. Ignore the global_functions and base_method tables and prefer the current GPerf implementation. Instead, add an extra base_arg field to VimLFuncDef that holds the number of the argument to use as the base (1-indexed, so that 0 may be used to refer to functions that cannot be used as methods). This also means we support using any argument as a base from the get-go, rather than just the first (Vim includes this ability in future patches, however). To mark a function as usable as a method, use the "base" key as described in eval.lua.
* vim-patch:8.1.1800: function call functions have too many argumentsSean Dewar2021-08-12
| | | | | | | | | | Problem: Function call functions have too many arguments. Solution: Pass values in a funcexe_T struct. https://github.com/vim/vim/commit/c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a Use FUNCEXE_INIT to initialize funcexe_T instances. call_callback() and other Vim listener related stuff is N/A.
* refactor(plines): move horizontal size functions to plines.cBjörn Linse2021-08-11
| | | | fix style.
* refactor(plines): remove implicit curwin chartabsize() functionBjörn Linse2021-08-10
|
* vim-patch:8.2.3254: win_gettype() does not recognize a quickfix windowJan Edmund Lazo2021-07-31
| | | | | | Problem: win_gettype() does not recognize a quickfix window. Solution: Add "quickfix" and "loclist". (Yegappan Lakshmanan, closes vim/vim#8676) https://github.com/vim/vim/commit/28d8421bfb3327d7a5e81369977e8fc108b0229e
* Merge pull request #15206 from ↵Björn Linse2021-07-30
|\ | | | | | | | | dundargoc/refactor/a-song-of-true-and-false/global-variables-2 refactor: replace TRUE/FALSE with true/false