aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
Commit message (Collapse)AuthorAge
...
| * vim-patch:9.1.0166: Internal error with blockwise getregion() in another ↵zeertzjq2024-03-12
| | | | | | | | | | | | | | | | | | | | buffer (#27819) Problem: Internal error with blockwise getregion() in another buffer Solution: Also change curwin->w_buffer when changing curbuf (zeertzjq) closes: vim/vim#14179 https://github.com/vim/vim/commit/5406eb8722bddb6a04876956f9a53c1752994851
| * vim-patch:9.1.0164: Internal error when passing invalid position to ↵zeertzjq2024-03-11
| | | | | | | | | | | | | | | | | | | | | | getregion() (#27805) Problem: Internal error or crash when passing invalid position to getregion(). Solution: Give an error for invalid position (zeertzjq). closes: vim/vim#14172 https://github.com/vim/vim/commit/26dd09ad5e86f4e2179be0181421bfab9a6b3b75
* | Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2024-03-09
|\|
| * vim-patch:9.1.0157: Duplicate assignment in f_getregion() (#27766)zeertzjq2024-03-08
| | | | | | | | | | | | | | | | | | Problem: Duplicate assignment in f_getregion(). Solution: Remove the duplicate assignment. Also improve getregion() docs wording and fix an unrelated typo (zeertzjq) closes: vim/vim#14154 https://github.com/vim/vim/commit/0df8f93bdaea77a1afb9f4eca94fe67ec73e6df2
| * vim-patch:9.1.0155: can only get getregion() from current buffer (#27757)zeertzjq2024-03-07
| | | | | | | | | | | | | | | | | | | | | | Problem: can only call getregion() for current buffer Solution: Allow to retrieve selections from different buffers (Shougo Matsushita) closes: vim/vim#14131 https://github.com/vim/vim/commit/84bf6e658da51126bdd2e50af1f40cabd149343f Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
| * fix(eval): make has('pythonx') work properly (#27739)zeertzjq2024-03-05
| | | | | | | | Problem: has('pythonx') always returns 1. Solution: Make it the same as has('python3').
| * fix(eval): correct failure return value for readfile/blob (#27722)Sean Dewar2024-03-03
| | | | | | | | | | Currently returns 0 on failure, but should return an empty list (or blob). Regressed in the big blob port of '21 (#15211).
| * vim-patch:9.1.0142: getregion() can be improved (#27662)zeertzjq2024-02-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: getregion() can be improved (after v9.1.120) Solution: change getregion() implementation to use pos as lists and one optional {opt} dictionary (Shougo Matsushita) Note: The following is a breaking change! Currently, the getregion() function (included as of patch v9.1.120) takes 3 arguments: the first 2 arguments are strings, describing a position, arg3 is the type string. However, that is slightly inflexible, there is no way to specify additional arguments. So let's instead change the function signature to: getregion(pos1, pos2 [, {Dict}]) where both pos1 and pos2 are lists. This is slightly cleaner, and gives us the flexibility to specify additional arguments as key/value pairs to the optional Dict arg. Now it supports the "type" key to specify the selection type (characterwise, blockwise or linewise) and now in addition one can also define the selection type, independently of what the 'selection' option actually is. Technically, this is a breaking change, but since the getregion() Vimscript function is still quite new, this should be fine. closes: vim/vim#14090 https://github.com/vim/vim/commit/19b718828d8d5fab52d94c6cdba694641879ab38 Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
| * refactor(metadata): generate all metadata in luabfredl2024-02-28
| | | | | | | | | | | | | | | | Then we can just load metadata in C as a single msgpack blob. Which also can be used directly as binarly data, instead of first unpacking all the functions and ui_events metadata to immediately pack it again, which was a bit of a silly walk (and one extra usecase of `msgpack_rpc_from_object` which will get yak shaved in the next PR)
| * vim-patch:9.1.0127: Naming a non-pointer variable "oap" is strangezeertzjq2024-02-23
| | | | | | | | | | | | | | | | | | | | Problem: Naming a non-pointer variable "oap" is strange. Solution: Rename it to "oa". Also prevent using freed memory in case of memory allocation failure. (zeertzjq) closes: vim/vim#14075 https://github.com/vim/vim/commit/5e3674b42da10b7e7c72d1f20f9a15379af1b60a
| * vim-patch:9.1.0126: Internal error when using upper-case mark in getregion()zeertzjq2024-02-23
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Internal error when passing mark in another buffer to getregion(). Solution: Don't allow marks in another buffer (zeertzjq) closes: vim/vim#14076 Internal error when passing mark in another buffer to getregion() https://github.com/vim/vim/commit/421b597470c118871c7081de00dd065e0e000b7e
| * vim-patch:9.1.0120: hard to get visual region using Vim scriptzeertzjq2024-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: hard to get visual region using Vim script Solution: Add getregion() Vim script function (Shougo Matsushita, Jakub Łuczyński) closes: vim/vim#13998 closes: vim/vim#11579 https://github.com/vim/vim/commit/3f905ab3c4f66562f4a224bf00f49d98a0b0da91 Cherry-pick changes from patch 9.1.0122, with :echom instead of :echow. Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
| * refactor(api): make freeing of return-value opt-in instead of opt outbfredl2024-02-21
| | | | | | | | | | | | | | | | | | As only a few API functions make use of explicit freeing of the return value, make it opt-in instead. The arena is always present under the hood, so `Arena *arena` arg now doesn't mean anything other than getting access to this arena. Also it is in principle possible to return an allocated value while still using the arena as scratch space for other stuff (unlikely, but there no reason to not allow it).
| * Merge pull request #27511 from bfredl/maparenabfredl2024-02-18
| |\ | | | | | | refactor(api): use arena for mappings, autocmd, channel info
| | * refactor(api): use an arena for mappingsbfredl2024-02-18
| | |
| * | fix(eval): skip over v:lua properly (#27517)zeertzjq2024-02-18
| |/ | | | | | | Problem: Error when parsing v:lua in a ternary expression. Solution: Set rettv->v_type for v:lua even if not evaluating.
| * refactor(eval): use arena when converting typvals to Objectbfredl2024-02-15
| | | | | | | | | | | | | | | | | | | | | | | | Note: this contains two _temporary_ changes which can be reverted once the Arena vs no-Arena distinction in API wrappers has been removed. Both nlua_push_Object and object_to_vim_take_luaref() has been changed to take the object argument as a pointer. This is not going to be necessary once these are only used with arena (or not at all) allocated Objects. The object_to_vim() variant which leaves luaref untouched might need to stay for a little longer.
| * refactor(lua): use Arena when converting from lua stack to API argsbfredl2024-02-13
| | | | | | | | | | | | | | | | | | | | | | | | and for return value of nlua_exec/nlua_call_ref, as this uses the same family of functions. NB: the handling of luaref:s is a bit of a mess. add api_luarefs_free_XX functions as a stop-gap as refactoring luarefs is a can of worms for another PR:s. as a minor feature/bug-fix, nvim_buf_call and nvim_win_call now preserves arbitrary return values.
| * refactor(api): make cstr_as_string accept "const char*"bfredl2024-02-09
| | | | | | | | | | In the context a String inside an Object/Dictionary etc is consumed, it is considered to be read-only.
| * vim-patch:9.0.1105: code is indented too much (#27314)zeertzjq2024-02-03
| | | | | | | | | | | | | | | | | | | | Problem: Code is indented too much. Solution: Use an early return. (Yegappan Lakshmanan, closes vim/vim#11756) https://github.com/vim/vim/commit/87c1cbbe984e60582f2536e4d3c2ce88cd474bb7 Omit free_eval_tofree_later(): Vim9 script only. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
| * fix(eval): properly support checking v:lua function in exists() (#27124)Raphael2024-01-22
| |
| * vim-patch:9.1.0009: Cannot easily get the list of matches (#27028)zeertzjq2024-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot easily get the list of matches Solution: Add the matchstrlist() and matchbufline() Vim script functions (Yegappan Lakshmanan) closes: vim/vim#13766 Omit CHECK_LIST_MATERIALIZE(): it populates a List with numbers only, and there is a check for strings below. https://github.com/vim/vim/commit/f93b1c881a99fa847a1bafa71877d7e16f18e6ef vim-patch:eb3475df0d92 runtime(doc): Replace non-breaking space with normal space (vim/vim#13868) https://github.com/vim/vim/commit/eb3475df0d927a178789cf8e7fc4983932e1cdbe Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
| * refactor(IWYU): fix headersdundargoc2024-01-11
| | | | | | | | | | | | Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
| * refactor(options): use schar_T representation for fillchars and listcharsbfredl2024-01-08
| | | | | | | | | | | | | | | | | | | | | | A bit big, but practically it was a lot simpler to change over all fillchars and all listchars at once, to not need to maintain two parallel implementations. This is mostly an internal refactor, but it also removes an arbitrary limitation: that 'fillchars' and 'listchars' values can only be single-codepoint characters. Now any character which fits into a single screen cell can be used.
| * refactor: follow style guidedundargoc2023-12-30
| |
| * refactor: run IWYU on entire repodundargoc2023-12-21
| | | | | | | | Reference: https://github.com/neovim/neovim/issues/6371.
| * refactor(IWYU): move decor provider types to decoration_defs.h (#26692)zeertzjq2023-12-21
| |
| * refactor: use `bool` to represent boolean valuesdundargoc2023-12-19
| |
| * docs: add style rule regarding initializationdundargoc2023-12-18
| | | | | | | | | | Specifically, specify that each initialization should be done on a separate line.
| * refactor: move non-symbols to defs.h headersdundargoc2023-12-17
| |
| * feat(eval): exists() function supports checking v:lua functions (#26485)Raphael2023-12-12
| | | | | | | | Problem: Vimscript function exists() can't check v:lua functions. Solution: Add support for v:lua functions to exists().
| * refactor(options): reduce `findoption()` usageFamiu Haque2023-12-09
| | | | | | | | | | | | Problem: Many places in the code use `findoption()` to access an option using its name, even if the option index is available. This is very slow because it requires looping through the options array over and over. Solution: Use option index instead of name wherever possible. Also introduce an `OptIndex` enum which contains the index for every option as enum constants, this eliminates the need to pass static option names as strings.
| * refactor: format casting of negative number better (#26482)zeertzjq2023-12-09
| |
| * fix(terminal): ignore $VIM and $VIMRUNTIME in pty jobsGregory Anders2023-12-07
| |
| * refactor: object_to_vim() cannot failJustin M. Keyes2023-12-07
| | | | | | | | | | Since the parent commit, object_to_vim() can't fail, so callers don't need to check its result.
| * fix(terminal): never propagate $COLORTERM from outer env (#26440)zeertzjq2023-12-07
| | | | | | | | If $COLORTERM is "truecolor" but the user sets 'notermguicolors', propagating $COLORTERM to :terminal usually doesn't work well.
| * build: don't define FUNC_ATTR_* as empty in headers (#26317)zeertzjq2023-11-30
| | | | | | | | | | | | FUNC_ATTR_* should only be used in .c files with generated headers. Defining FUNC_ATTR_* as empty in headers causes misuses of them to be silently ignored. Instead don't define them by default, and only define them as empty after a .c file has included its generated header.
* | Merge remote-tracking branch 'upstream/master' into userreguserregJosh Rahm2023-11-29
|\|
| * refactor: fix headers with IWYUdundargoc2023-11-28
| |
| * build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
| |
| * build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
| |
| * build(IWYU): replace most private mappings with pragmas (#26247)zeertzjq2023-11-27
| |
| * docs: small fixes (#26154)dundargoc2023-11-27
| |
| * build(IWYU): replace public-to-public mappings with pragmas (#26237)zeertzjq2023-11-27
| |
| * build: rework IWYU mapping filesdundargoc2023-11-25
| | | | | | | | | | Create mapping to most of the C spec and some POSIX specific functions. This is more robust than relying files shipped with IWYU.
| * refactor: enable formatting for ternariesdundargoc2023-11-20
| | | | | | | | | | | | This requires removing the "Inner expression should be aligned" rule from clint as it prevents essentially any formatting regarding ternary operators.
| * refactor(grid): make screen rendering more multibyte than ever beforebfredl2023-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: buffer text with composing chars are converted from UTF-8 to an array of up to seven UTF-32 values and then converted back to UTF-8 strings. Solution: Convert buffer text directly to UTF-8 based schar_T values. The limit of the text size is now in schar_T bytes, which is currently 31+1 but easily could be raised as it no longer multiplies the size of the entire screen grid when not used, the full size is only required for temporary scratch buffers. Also does some general cleanup to win_line text handling, which was unnecessarily complicated due to multibyte rendering being an "opt-in" feature long ago. Nowadays, a char is just a char, regardless if it consists of one ASCII byte or multiple bytes.
| * build: remove PVSdundargoc2023-11-12
| | | | | | | | | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
| * fix(context): don't crash on invalid arg to nvim_get_context (#25977)zeertzjq2023-11-11
| | | | | | | | Note: The crash happens in the second test case when using uninitialized memory, and therefore doesn't happen with ASAN.
| * fix(f_wait): flush UI before blocking (#25962)zeertzjq2023-11-10
| |