aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
Commit message (Collapse)AuthorAge
...
| * 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.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.
| * 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.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
* 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.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
* vim-patch:8.2.2957: using getchar() in Vim9 script is problematicJan Edmund Lazo2021-07-29
| | | | | | | | | | | | Problem: Using getchar() in Vim9 script is problematic. Solution: Add getcharstr(). (closes vim/vim#8343) https://github.com/vim/vim/commit/3a7503c34c65ed15cc08deb5b54aaf2ea51525b4 Cherry-pick Test_getchar() changes from patch v8.1.2304 to sync with upstream. Port f_getcharstr() to src/nvim/eval/funcs.c, not src/nvim/getchar.c. Patch v8.1.2042 is not ported yet.
* refactor: replace TRUE/FALSE with true/falseDundar Göc2021-07-26
| | | | Focus is on global variables.
* Fix line length clint errorGregory Anders2021-07-12
|
* Rename stdin to stdin_modeGregory Anders2021-07-12
| | | | stdin is a macro in Windows builds.
* feat(job): add parameter to close stdinGregory Anders2021-07-12
| | | | | | | | | | | | | | | | Some programs behave differently when they detect that stdin is being piped. This can be problematic when these programs are used with the job control API where stdin is attached, but not typically used. It is possible to run the job using a PTY which circumvents this problem, but that includes a lot of overhead when simply closing the stdin pipe would suffice. To enable this behavior, add a new parameter to the jobstart options dict called "stdin" with two valid values: "pipe" (the default) implements the existing behavior of opening a channel for stdin and "null" which disconnects stdin (or, if you prefer, connects it to /dev/null). This is extensible so that other modes can be added in the future.
* undo: reduce reliance on curbufThomas Vigouroux2021-07-06
|
* vim-patch:8.1.0897: can modify a:000 when using a reference (#14902)Jan Edmund Lazo2021-06-26
| | | | | | Problem: Can modify a:000 when using a reference. Solution: Make check for locked variable stricter. (Ozaki Kiichi, closes vim/vim#3930) https://github.com/vim/vim/commit/05c00c038bc16e862e17f9e5c8d5a72af6cf7788
* vim-patch:8.2.0945: cannot use "z=" when 'spell' is offJan Edmund Lazo2021-06-12
| | | | | | | Problem: Cannot use "z=" when 'spell' is off. Solution: Make "z=" work even when 'spell' is off. (Christian Brabandt, Gary Johnson, closes vim/vim#6227) https://github.com/vim/vim/commit/152e79e94bb935e75b866bd55479648cde11066a
* fixup! vim-patch:8.2.2136: Vim9: Using uninitialized variableJan Edmund Lazo2021-06-05
| | | | | | Resolve pvs/v560 error. mods is nonnull in the modified inner if-condition. because it is checked for NULL in the outer if-condition.
* fix(job): Deduplicate env var names on WindowsJames McCoy2021-05-18
| | | | | | | | | | | | | | | | Windows handles environment variable names case-insensitively (i.e., %Path% can be accessed via %PATH%). Since nvim explicitly creates the environment block for jobs, we need to ensure it doesn't contain duplicate names with different cases (e.g., both %Path% and %PATH%) as that can confuse processes using the environment. `f_environ()` now converts all env var names to upper-case on Windows, since it does duplicate detection and also provides the base environment for jobs. Similarly, `create_environment()` converts any env var names supplied in the job opts to upper-case so they can be compared against what we get from `f_environ()`. Closes #14541
* Add 'FUNC_ATTR_NONNULL_RET' to nonnull alloc funcs (#14559)Jan Edmund Lazo2021-05-15
|
* vim-patch:8.1.1967: line() only works for the current windowJan Edmund Lazo2021-05-12
| | | | | | Problem: Line() only works for the current window. Solution: Add an optional argument for the window to use. https://github.com/vim/vim/commit/8e0a8e7eb7c177807f44db6b76d8e52314248ab5
* Revert "vim-patch:8.1.1378: delete() can not handle a file name that looks ↵Marco Hinz2021-05-12
| | | | | | | | | like a pattern (#12784)" This reverts commit 4be0e92db01a502863ac4bb26dd0fee16d833145. Unfortunately, that commit stalled the Windows builds on GHA and likely requires other patches to work properly.
* Merge pull request #14403 from seandewar/vim-8.2.1933Jan Edmund Lazo2021-05-09
|\ | | | | vim-patch:8.2.{0174,1933,1935,1946,2286,2287}
| * vim-patch:8.2.1933: cannot sort using locale orderingSean Dewar2021-04-20
| | | | | | | | | | | | | | Problem: Cannot sort using locale ordering. Solution: Add a flag for :sort and sort() to use the locale. (Dominique Pellé, closes vim/vim#7237) https://github.com/vim/vim/commit/55e29611d20bca14fa5efc61385bc8a6b7acd9e2
* | Merge pull request #13664 from ivechan/win_exectuteJan Edmund Lazo2021-05-07
|\ \ | | | | | | vim-patch:8.1.{1418,1425,1832,2124},8.2.{0137, 2340}
| * | vim-patch:8.2.2340: win_execute() unexpectedly returns number zero when failingjing2021-05-06
| | | | | | | | | | | | | | | | | | Problem: win_execute() unexpectedly returns number zero when failing. Solution: Return an empty string. (closes vim/vim#7665) https://github.com/vim/vim/commit/37487e16da7877129edee8d11b9b7f5c8df312c6
| * | vim-patch:8.1.2124: ruler is not updated if win_execute() moves cursorjing2021-05-06
| | | | | | | | | | | | | | | | | | Problem: Ruler is not updated if win_execute() moves cursor. Solution: Update the status line. (closes vim/vim#5022) https://github.com/vim/vim/commit/345f28df5482cd35f5fa74b06443376379f113b0
| * | vim-patch:8.1.1832: win_execute() does not work in other tabjing2021-05-06
| | | | | | | | | | | | | | | | | | Problem: Win_execute() does not work in other tab. (Rick Howe) Solution: Take care of the tab. (closes vim/vim#4792) https://github.com/vim/vim/commit/820680b9ff1de8699156c7b060f97e5c0b87ad15
| * | vim-patch:8.1.1425: win_execute() does not set window pointers properlyjing2021-05-06
| | | | | | | | | | | | | | | | | | | | | Problem: Win_execute() does not set window pointers properly. Solution: Use switch_win_noblock(). Also execute autocommands in a popup window. https://github.com/vim/vim/commit/89adc3a1371d211f7766f3dbc0975ecb2f862327
| * | vim-patch:8.1.1418: win_execute() is not implemented yetjing2021-05-06
| | | | | | | | | | | | | | | | | | Problem: Win_execute() is not implemented yet. Solution: Implement it. https://github.com/vim/vim/commit/868b7b6712ea4f2232eeeae18c5cbbbddf2ee84d
* | | vim-patch:8.1.1378: delete() can not handle a file name that looks like a ↵Shougo2021-05-07
| | | | | | | | | | | | | | | | | | | | | | | | pattern (#12784) Problem: Delete() can not handle a file name that looks like a pattern. Solution: Use readdir() instead of appending "/*" and expanding wildcards. (Ken Takata, closes vim/vim#4424, closes vim/vim#696) https://github.com/vim/vim/commit/701ff0a3e53d253d7300c385e582659bbff7860d
* | | vim-patch:8.2.1166: once mouse move events are enabled getchar() returns themJan Edmund Lazo2021-05-06
|/ / | | | | | | | | | | Problem: Once mouse move events are enabled getchar() returns them. Solution: Ignore K_MOUSEMOVE in getchar(). (closes vim/vim#6424) https://github.com/vim/vim/commit/ae97b94176062d30ea8c68bb83cde034c5150c78
* | vim-patch:8.2.1588: cannot read back the prompt of a prompt bufferSean Dewar2021-04-21
| | | | | | | | | | | | | | | | | | Problem: Cannot read back the prompt of a prompt buffer. Solution: Add prompt_getprompt(). (Ben Jackson, closes vim/vim#6851) https://github.com/vim/vim/commit/077cc7aa0e0c431e97795612374fe17fe7c88803 Updated prompt_getprompt() doc to https://github.com/vim/vim/commit/cb80aa2d53e56d3aba3b3c439fb467f29a750c5e and removed mention of method syntax usage (not supported by Nvim).
* | eval: port tv_get_buf_from_arg()Sean Dewar2021-04-21
|/ | | | | | | | Cherry-picked from v8.2.1562, but uses Nvim's tv_check_str_or_nr(). Required for v8.2.1588. It isn't used for f_bufnr() to avoid a double error message if the first argument isn't a number or string similiar to what's seen in Vim.
* vim-patch:8.0.1505: debugger can't break on a conditionJan Edmund Lazo2021-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Debugger can't break on a condition. (Charles Campbell) Solution: Add ":breakadd expr". (Christian Brabandt, closes vim/vim#859) https://github.com/vim/vim/commit/c6f9f739d32084923c3031cbf6f581f8c8bf7fd2 Do not port "has_watchexpr()" to avoid dead code. "has_watchexpr()" always returns 0 because "debug_expr" is always 0. Restore "eval_expr()" as a wrapper to allocate "typval_T" for "eval0()". Remove it in later patches. Include "typval_compare()" changes from patch v8.1.0958, partially ported in 8b60368c1b9e23f0695557da170d416d71f7e6a3. Close https://github.com/neovim/neovim/pull/12373 N/A patches for version.c: vim-patch:8.2.2720: GTK menu tooltip moves the cursor Problem: GTK menu tooltip moves the cursor. Solution: Position the cursor after displaying the tooltip. Do not show the tooltip when editing the command line. https://github.com/vim/vim/commit/01ac0a1f664c5b1ffd5c9ef196d4b47edf2fd494
* vim-patch:8.2.2704: adding a lot of completions can be a bit slowShougo Matsushita2021-04-05
| | | | | | | Problem: Adding a lot of completions can be a bit slow. Solution: Use fast_breakcheck() instead of ui_breakcheck() when adding a list of completions. (Ben Jackson, closes vim/vim#8061) https://github.com/vim/vim/commit/440cf096fad7bf628974abc344343b823d79a006
* Merge pull request #14199 from bfredl/chansend2Björn Linse2021-04-04
|\ | | | | api: fix use-after-free in nvim_chan_send
| * api: fix use-after-free in nvim_chan_sendBjörn Linse2021-04-04
| |
* | vim-patch:8.1.1682: placing a larger number of ...Lewis Russell2021-04-03
|/ | | | | | | | ...signs is slow Problem: Placing a larger number of signs is slow. Solution: Add functions for dealing with a list of signs. (Yegappan Lakshmanan, closes #4636)
* luaref: simplify handling of table callables and fix leak in vim.fn.call(table)Björn Linse2021-04-03
| | | | I AM THE TABLE
* vim-patch:8.2.2694: when 'matchpairs' is empty every character beeps (#14279)Jan Edmund Lazo2021-04-03
| | | | | | Problem: When 'matchpairs' is empty every character beeps. (Marco Hinz) Solution: Bail out when no character in 'matchpairs' was found. (closes vim/vim#8053) Add assert_nobeep(). https://github.com/vim/vim/commit/5b8cabfef7c3707f3e53e13844d90e5a217e1e84
* vim-patch:8.1.0989: various small code uglinessJan Edmund Lazo2021-03-29
| | | | | | | Problem: Various small code ugliness. Solution: Remove pointless NULL checks. Fix function calls. Fix typos. (Dominique Pelle, closes vim/vim#4060) https://github.com/vim/vim/commit/bdace838c67c1bd94e55e34270a8325933891466
* vim-patch:8.1.0542: shiftwidth() does not take 'vartabstop' into accountVVKot2021-03-28
| | | | | | | | Problem: shiftwidth() does not take 'vartabstop' into account. Solution: Use the cursor position or a position explicitly passed. Also make >> and << work better with 'vartabstop'. (Christian Brabandt) https://github.com/vim/vim/commit/f951416a8396a54bbbe21de1a8b16716428549f2