aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.lua
Commit message (Collapse)AuthorAge
...
* vim-patch:c2bd205254c8Christian Clason2023-08-09
| | | | | | | | | | | | | Change "the" to "then" under ':help bufload()' (vim/vim#12662) https://github.com/vim/vim/commit/c2bd205254c89ecf46e08965f53d7991315d9c98 N/A commits: vim-patch:64dea84bb05a (we have our own manpager at home) vim-patch:958e15bb1c7d (we have our own editorconfig syntax file) vim-patch:c41b3c9f95ac (we don't have defaults.vim) Co-authored-by: Daniel Steinberg <dstein64@users.noreply.github.com>
* fix(lua): improve annotations for stricter luals diagnostics (#24609)Christian Clason2023-08-09
| | | | | | | | | | | | | | | Problem: luals returns stricter diagnostics with bundled luarc.json Solution: Improve some function and type annotations: * use recognized uv.* types * disable diagnostic for global `vim` in shared.lua * docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type) * add type alias for lpeg pattern * fix return annotation for `vim.secure.trust` * rename local Range object in vim.version (shadows `Range` in vim.treesitter) * fix some "missing fields" warnings * add missing required fields for test functions in eval.lua * rename lsp meta files for consistency
* docs(builtin): fix some missing lines (#24615)Sean Dewar2023-08-08
| | | | | | These two functions seem to have previously had their docs start on the same line as the signature, which I guess contributed to the lines being lost (though I checked all other such functions from before again and these were the only two).
* docs(lua): fix generated `fname` param annotations #24533Marc Jakobi2023-08-02
|
* docs(builtin): fix alignment of comments in code blocks (#24529)zeertzjq2023-08-02
|
* docs: drop "Can also be used as a method" #24508Justin M. Keyes2023-08-01
| | | | | | | | Now that we "own" builtin.txt, we cant remove the repetitive mention of Vimscript's UFCS syntax. It's noisy to mention this for each function, and it's also not a Vimscript feature that should be encouraged. Also change the builtin.txt heading to "NVIM REFERENCE MANUAL", which indicates when a help file is Nvim-owned.
* feat(lua-types): types for vim.api.* (#24523)Lewis Russell2023-08-01
|
* docs(builtin): fix and annotate language blocks (#24506)Lewis Russell2023-08-01
|
* feat(docs): generate builtin.txt (#24493)Lewis Russell2023-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - eval.lua is now the source of truth. - Formatting is much more consistent. - Fixed Lua type generation for polymorphic functions (get(), etc). - Removed "Overview" section from builtin.txt - Can generate this if we really want it. - Moved functions from sign.txt and testing.txt into builtin.txt. - Removed the *timer* *timers* tags since libuv timers via vim.uv should be preferred. - Removed the temp-file-name tag from tempname() - Moved lueval() from lua.txt to builtin.txt. * Fix indent * fixup! * fixup! fixup! * fixup! better tag formatting * fixup: revert changes no longer needed * fixup! CI --------- Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(gen_vimfn_types): don't include tag before signature's line (#24492)zeertzjq2023-07-26
| | | | | | | When signature is a bit long or there are too many tags, the tags appear before the signature's line. Don't include the line with tags in the previous function' docs. Also fix lint warnings.
* feat(lua): typing for vim.fn.* (#24473)Lewis Russell2023-07-26
| | | | | | | Problem: No LSP information for `vim.fn.*` Solution: Add meta file for `vim.fn.*`.
* fix(messages): use "Vimscript" instead of "VimL" #24111Justin M. Keyes2023-06-22
| | | | followup to #24109 fix #16150
* vim-patch:8.2.2607: strcharpart() cannot include composing characterszeertzjq2023-05-04
| | | | | | | | | Problem: strcharpart() cannot include composing characters. Solution: Add the {skipcc} argument. https://github.com/vim/vim/commit/02b4d9b18a03549b68e364e428392b7a62766c74 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:9.0.1485: no functions for converting from/to UTF-16 index (#23318)zeertzjq2023-04-26
| | | | | | | | | Problem: no functions for converting from/to UTF-16 index. Solution: Add UTF-16 flag to existing funtions and add strutf16len() and utf16idx(). (Yegappan Lakshmanan, closes vim/vim#12216) https://github.com/vim/vim/commit/67672ef097dd708244ff042a8364994da2b91e75 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.5019: cannot get the first screen column of a character (#23312)zeertzjq2023-04-25
| | | | | | | | | Problem: Cannot get the first screen column of a character. Solution: Let virtcol() optionally return a list. (closes vim/vim#10482, closes vim/vim#7964) https://github.com/vim/vim/commit/0f7a3e1de6f71e8e1423fe594890d6aa7f94e132 Co-authored-by: LemonBoy <thatlemon@gmail.com>
* vim-patch:9.0.1007: there is no way to get a list of swap file nameszeertzjq2023-04-19
| | | | | | | | | | | | | | | | | | | | | Problem: There is no way to get a list of swap file names. Solution: Add the swapfilelist() function. Use it in the test script to clean up. Remove deleting individual swap files. https://github.com/vim/vim/commit/c216a7a21a25a701b84b79abc1ba6ab0baa3a311 vim-patch:9.0.1005: a failed test may leave a swap file behind Problem: A failed test may leave a swap file behind. Solution: Delete the swap file to avoid another test to fail. Use another file name. https://github.com/vim/vim/commit/d0f8d39d20f8d42f7451f781f7be0bcd20e06741 Cherry-pick test_window_cmd.vim changes from patch 8.2.1593. Remove FUNC_ATTR_UNUSED from eval functions as fptr is always unused. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0269: getscriptinfo() does not include the versionzeertzjq2023-04-15
| | | | | | | | | | | Problem: getscriptinfo() does not include the version. Cannot select entries by script name. Solution: Add the "version" item and the "name" argument. (Yegappan Lakshmanan, closes vim/vim#10962) https://github.com/vim/vim/commit/520f6ef60a59f7b5f3da9199999d13dbe817d3ce Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.0244: cannot easily get the list of sourced scripts (#22596)Michal Liszcz2023-03-11
| | | | | | | | | | | Problem: Cannot easily get the list of sourced scripts. Solution: Add the getscriptinfo() function. (Yegappan Lakshmanan, closes vim/vim#10957) https://github.com/vim/vim/commit/f768c3d19c518822d89dec4cc3947ddeea249316 Cherry-pick usr_41.txt change from a later runtime update. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.3438: cannot manipulate blobszeertzjq2023-02-28
| | | | | | | | | | Problem: Cannot manipulate blobs. Solution: Add blob2list() and list2blob(). (Yegappan Lakshmanan, closes vim/vim#8868) https://github.com/vim/vim/commit/5dfe467432638fac2e0156a2f9cd0d9eb569fb39 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.0795: readblob() always reads the whole filezeertzjq2023-02-28
| | | | | | | | | | | | | Problem: readblob() always reads the whole file. Solution: Add arguments to read part of the file. (Ken Takata, closes vim/vim#11402) https://github.com/vim/vim/commit/11df3aeee548b959ccd4b9a4d3c44651eab6b3ce Remove trailing whitespace in test as done in patch 9.0.1257. Move the help for rand() before range(). Co-authored-by: K.Takata <kentkt@csc.jp>
* vim-patch:8.2.2336: Vim9: not possible to extend dictionary with different ↵zeertzjq2023-02-27
| | | | | | | | | | | type (#22425) Problem: Vim9: it is not possible to extend a dictionary with different item types. Solution: Add extendnew(). (closes vim/vim#7666) https://github.com/vim/vim/commit/b0e6b513648db7035046613431a4aa9d71ef4653 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0196: finding value in list may require a for loopzeertzjq2023-02-27
| | | | | | | | | Problem: Finding value in list may require a for loop. Solution: Add indexof(). (Yegappan Lakshmanan, closes vim/vim#10903) https://github.com/vim/vim/commit/b218655d5a485f5b193fb18d7240837d42b89812 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.2449: Vim9: flatten() always changes the list typezeertzjq2023-02-24
| | | | | | | | | Problem: Vim9: flatten() always changes the list type. Solution: Disallow using flatten() and add flattennew(). https://github.com/vim/vim/commit/3b690069730805a147d45d92eaca4dc838272d1d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(lua): mark some eval functions that can run in API-fastLewis Russell2023-02-02
|
* vim-patch:9.0.1212: cannot read back what setcellwidths() has done (#21867)zeertzjq2023-01-18
| | | | | | | | Problem: Cannot read back what setcellwidths() has done. Solution: Add getcellwidths(). (Kota Kato, closes vim/vim#11837) https://github.com/vim/vim/commit/66bb9ae70f7371456ed76518076d2a344f8ab417 Co-authored-by: Kota Kato <github@kat0h.com>
* vim-patch:9.0.0916: getbufline() is inefficient for getting a single linezeertzjq2022-11-22
| | | | | | | | | | | Problem: getbufline() is inefficient for getting a single line. Solution: Add getbufoneline(). https://github.com/vim/vim/commit/ce30ccc06af7f2c03762e5b18dde37b26ea6ec42 Cherry-pick part of usr_41.txt from patch 8.1.1628. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0863: col() and charcol() only work for the current window ↵zeertzjq2022-11-13
| | | | | | | | | | | | | (#21038) Problem: col() and charcol() only work for the current window. Solution: Add an optional winid argument. (Yegappan Lakshmanan, closes vim/vim#11466, closes vim/vim#11461) https://github.com/vim/vim/commit/4c8d2f02b3ce037bbe1d5ee12887e343c6bde88f Cherry-pick test_functions.vim change from patch 8.2.0633. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.4679: cannot have expandcmd() give an error message for mistakeszeertzjq2022-11-05
| | | | | | | | | Problem: Cannot have expandcmd() give an error message for mistakes. Solution: Add an optional argument to give errors. Fix memory leak when expanding files fails. (Yegappan Lakshmanan, closes vim/vim#10071) https://github.com/vim/vim/commit/2b74b6805b5c8c4836b66df5d949f5ff6a77f8c7 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.2606: strchars() defaults to counting composing characterszeertzjq2022-11-05
| | | | | | | | | | | Problem: strchars() defaults to counting composing characters. Solution: Add strcharlen() which ignores composing characters. https://github.com/vim/vim/commit/70ce8a1561c5396e4c4381f76a005cbb97646f80 Use docs from latest Vim instead. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1631: test_fails() does not check the context of the line numberzeertzjq2022-11-05
| | | | | | | | | Problem: test_fails() does not check the context of the line number. Solution: Use another argument to specify the context of the line number. https://github.com/vim/vim/commit/9bd5d879c2ecfbdbb168b090e12f4b89724a302e Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1479: Vim9: error for list index uses wrong line numberzeertzjq2022-11-05
| | | | | | | | | | Problem: Vim9: error for list index uses wrong line number. Solution: Set source line number. (closes vim/vim#6724) Add a way to assert the line number of the error with assert_fails(). https://github.com/vim/vim/commit/1d634542cf5ebcd1d5d83bd124b3e1d5e7c96c58 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2343: Vim9: return type of readfile() is any (#20896)zeertzjq2022-11-01
| | | | | | | | | Problem: Vim9: return type of readfile() is any. Solution: Add readblob() so that readfile() can be expected to always return a list of strings. (closes vim/vim#7671) https://github.com/vim/vim/commit/c423ad77ed763c11ba67729bbf63c1cf0915231f Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1544: cannot translate messages in a Vim scriptzeertzjq2022-10-28
| | | | | | | | | | Problem: Cannot translate messages in a Vim script. Solution: Add gettext(). Try it out for a few messages in the options window. https://github.com/vim/vim/commit/0b39c3fd4c5d1c8ebd2efa85fced7df5e17efd3b Co-authored-by: Bram Moolenaar <Bram@vim.org>
* feat(cscope)!: removeLewis Russell2022-10-13
|
* vim-patch:9.0.0449: there is no easy way to translate a key code into a ↵zeertzjq2022-09-13
| | | | | | | | | | | | | string (#20168) Problem: There is no easy way to translate a string with a key code into a readable string. Solution: Add the keytrans() function. (closes vim/vim#11114) https://github.com/vim/vim/commit/cdc839353f68ca43db6446e1b727fc7ba657b738 vim-patch:7b2d87220c6c Add missing part of patch https://github.com/vim/vim/commit/7b2d87220c6c974d5cdae672b6f9620a6bcbd1dc
* vim-patch:8.2.5034: there is no way to get the byte index from a virtual columnzeertzjq2022-09-12
| | | | | | | | | | Problem: There is no way to get the byte index from a virtual column. Solution: Add virtcol2col(). (Yegappan Lakshmanan, closes vim/vim#10477, closes vim/vim#10098) https://github.com/vim/vim/commit/5a6ec10cc80ab02eeff644ab19b82312630ea855 Cherry-pick tv_check_for_number_arg() from Vim. Cherry-pick pathshorten() doc change.
* vim-patch:9.0.0285: it is not easy to change the command line from a plugin ↵Shougo2022-08-29
| | | | | | | | | | (#19979) vim-patch:9.0.0285: it is not easy to change the command line from a plugin Problem: It is not easy to change the command line from a plugin. Solution: Add setcmdline(). (Shougo Matsushita, closes vim/vim#10869) https://github.com/vim/vim/commit/07ea5f1509fe8dafe3262ed2702b4d0fc99e288b
* perf(api): allow to use an arena for return valuesbfredl2022-08-23
|
* vim-patch:8.2.{1536,1540}: charclass() (#19748)zeertzjq2022-08-13
| | | | | | | | | | | | | | | | | | | | | vim-patch:8.2.1536: cannot get the class of a character; emoji widths are wrong Problem: Cannot get the class of a character; emoji widths are wrong in some environments. Solution: Add charclass(). Update some emoji widths. Add script to check emoji widths. https://github.com/vim/vim/commit/4e4473c927167fd24e5c8df90e0e8035080cf2da Use latest charclass() docs from Vim. Rewrite DoIt() in emoji_list.vim in Lua. Omit emoji table updates: - emoji_width update looks wrong as these added ranges are only double-width when followed by 0xFE0F. - Other updates are too old. vim-patch:8.2.1540: the user cannot try out emoji character widths Problem: The user cannot try out emoji character widths. Solution: Move the emoji script to the runtime/tools directory. https://github.com/vim/vim/commit/98945560c1ae6e2ddee820a7de718a36e3f4b6e5
* vim-patch:8.2.1535: it is not possible to specify cell widths of characterszeertzjq2022-08-08
| | | | | | | | Problem: It is not possible to specify cell widths of characters. Solution: Add setcellwidths(). https://github.com/vim/vim/commit/08aac3c6192f0103cb87e280270a32b50e653be1 Co-Authored-By: delphinus <me@delphinus.dev>
* vim-patch:8.2.0385: menu functionality insufficiently testedzeertzjq2022-08-05
| | | | | | | | | | | Problem: Menu functionality insufficiently tested. Solution: Add tests. Add menu_info(). (Yegappan Lakshmanan, closes vim/vim#5760) https://github.com/vim/vim/commit/0eabd4dc8ff50658f0ea0e92c7918a42242f6b80 Omit feedkeys() change: even if "L" flag is implemented it will likely use input_enqueue(), which already checks for interrupts. Omit Test_mouse_popup_menu(): already tested in Lua.
* vim-patch:8.2.0807: cannot easily restore a mappingzeertzjq2022-08-01
| | | | | | | | | | | | | | | | Problem: Cannot easily restore a mapping. Solution: Add mapset(). https://github.com/vim/vim/commit/4c9243f9fb708c9010867d3cc8e928f36b58509a Use MapArgument to reduce number of arguments of map_add(). N/A patches for version.c: vim-patch:8.2.0809: build failure with small features Problem: Build failure with small features. (Tony Mechelynck) Solution: Move "expr" inside #ifdef. https://github.com/vim/vim/commit/5a80f8ad5dc0b2cc63400255dcf3c63f6c1a2ef9
* feat(lua): allow some viml functions to run in fastLewis Russell2022-05-17
| | | | | This change adds the necessary plumbing to annotate functions in funcs.c as being allowed in run in luv fast events.
* feat: cmdline funcs (#18284)Shougo2022-05-09
| | | | | | | | | | | | | | vim-patch:8.2.4903: cannot get the current cmdline completion type and position Problem: Cannot get the current cmdline completion type and position. Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita, closes vim/vim#10344) https://github.com/vim/vim/commit/79d599b8772022af1d657f368c2fc97aa342c0da vim-patch:8.2.4910: imperfect coding Problem: Imperfect coding. Solution: Make code nicer. https://github.com/vim/vim/commit/9ff7d717aa3176de5c61de340deb93f41c7780fc
* vim-patch:8.2.3226: new digraph functions use old naming schemezeertzjq2022-04-12
| | | | | | Problem: New digraph functions use old naming scheme. Solution: Use the digraph_ prefix. (Hirohito Higashi, closes vim/vim#8580) https://github.com/vim/vim/commit/29b857150c111a455f1a38a8f748243524f692e1
* vim-patch:8.2.3184: cannot add a digraph with a leading spacezeertzjq2022-04-12
| | | | | | | | | | | | | | | Problem: Cannot add a digraph with a leading space. It is not easy to list existing digraphs. Solution: Add setdigraph(), setdigraphlist(), getdigraph() and getdigraphlist(). (closes vim/vim#8580) https://github.com/vim/vim/commit/6106504e9edc8500131f7a36e59bc146f90180fa Use GA_APPEND_VIA_PTR in registerdigraph(). Use tv_list_append_*() in getdigraphlist_appendpair(). Put the error messages in digraph.c. E196 is N/A. Remove mentions about 'encoding' being non-Unicode. Nvim doesn't support setting encoding=japan, so skip a test.
* vim-patch:8.2.0915: search() cannot skip over matches like searchpair() canSean Dewar2022-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Search() cannot skip over matches like searchpair() can. Solution: Add an optional "skip" argument. (Christian Brabandt, closes vim/vim#861) https://github.com/vim/vim/commit/adc17a5f9d207fd1623fd923457a46efc9214777 Enable skip arg usage in autoload/freebasic.vim evalarg_T doesn't really matter because it's deleted in v8.2.0918 (and reincarnated for Vim9 script in v8.2.1047), but I found out too late :P Anyway: - Port evalarg_T into eval.h and use const char * and Callback fields - Use EVALARG_INIT to initialize - Return bool over OK/FAIL from evalarg functions - Remove check from evalarg_clean as callback_free ignores None callbacks anyway - Move eva_buf field into evalarg_get as a local (not sure what reason it has being in the struct) N/A patches for version.c: vim-patch:8.2.4355: unnecessary call to check_colorcolumn() Problem: Unnecessary call to check_colorcolumn(). Solution: Remove the call. (Sean Dewar, closes vim/vim#9748) https://github.com/vim/vim/commit/0f7ff851cb721bb3c07261adbf82b591229f530d
* Merge pull request #16553 from seandewar/vim-8.2.0878Sean Dewar2022-02-08
|\ | | | | vim-patch:8.2.{0882,1051,1083}: port `reduce()` function
| * feat(eval): partially port v8.2.0878Sean Dewar2022-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No reduce() function. Solution: Add a reduce() function. (closes vim/vim#5481) https://github.com/vim/vim/commit/85629985b71035608a37ba3bde86968481490d46 Needs CHECK_LIST_MATERIALIZE from v8.2.0751 (and range_list_materialize from 8.2.0149). Move e_reduceempty to funcs.c, as it's only used there. Make it static. Use tv_blob_len, tv_list_len == 0 for empty checks. Replace vim_memset(&funcexe, 0, ...) with FUNCEXE_INIT. Leave li initially undefined (tv_list_first returns NULL if list is NULL). This patch has a memory leak fixed by v8.2.0882.