aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
Commit message (Collapse)AuthorAge
* Merge branch 'userreg' into mixJosh Rahm2022-09-12
|\
| * Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2022-09-12
| |\
| * \ Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2022-08-22
| |\ \
| * | | feat(userreg): Add user-defined registers to Neovim.Josh Rahm2022-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change unlocks additional registers for Neovim by allowing a user to define their own behavior for non-builtin registers. This is accopmlished through a new option 'userregfunc' The 'userregfunc' defines the function to call when handling a register for which there is no builtin functionality. The 'userregfunc' function should take 3 arguments: action - Either "yank" or "put" register - The character corresponding to the register content - In the case of action == "yank", the dictionary describing the yanked content, with the following keys: {type} - Either "char", "line" or "block" {lines} - The lines being yanked as a list {width} - The width in case of "block" mode. {additional_data} - Additional data (can be returned in "put" mode) In case of "put" this function should return the content to put. This content can be either: * A dictionary in the same template as content above. * A list of strings. This will be assumed to be "line" mode. * A string. This will be assumed to be "char" mode. An example of a "null" 'userregfunc' that provides an implementation identical to traditional vim registers would be: let s:contents = {} function! MyUserregFunction(action, register, content) abort if a:action == "put" return get(s:contents, a:register, "") else let s:contents[a:register] = a:content endif endfunction set userregfun=MyUserregFunction It is important to note that any valid unicode character can now be a register, including something like @☺. This change also addresses the multibyte parsing issues surrounding let @a = 'xyz' let @🔨 = 'hammer'
* | | | Merge remote-tracking branch 'upstream/master' into usermarksJosh Rahm2022-09-12
|\ \ \ \ | | |_|/ | |/| |
| * | | refactor: replace char_u with charDundar Göc2022-09-10
| | | | | | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | | refactor: replace char_u with charDundar Göc2022-09-09
| | | | | | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | | vim-patch:9.0.0409: #{g:x} was seen as a curly-braces expressionii142022-09-08
| | | | | | | | | | | | | | | | | | | | | | | | Problem: #{g:x} was seen as a curly-braces expression. Solution: Do never see #{} as a curly-braces expression. (closes vim/vim#11075) https://github.com/vim/vim/commit/7c7e1e9b98d4e5dbe7358c795a635c6f1f36f418
| * | | vim-patch:8.2.3702: first key in dict is seen as curly expression and failszeertzjq2022-09-08
| | | | | | | | | | | | | | | | | | | | | | | | Problem: First key in dict is seen as curly expression and fails. Solution: Ignore failure of curly expression. (closes vim/vim#9247) https://github.com/vim/vim/commit/98cb90ef865089a5ddd20bc0303d449fb7d97fb2
| * | | refactor: replace char_u with charDundar Göc2022-09-06
| | | | | | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | | refactor: replace char_u with charDundar Göc2022-09-01
| | | | | | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | | Merge pull request #20022 from dundargoc/refactor/char_u/6bfredl2022-09-01
| |\ \ \ | | | | | | | | | | refactor: replace char_u with char 6
| | * | | refactor: replace char_u with charDundar Göc2022-08-31
| | | | | | | | | | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | | | Merge pull request #16396 from bfredl/luaeventbfredl2022-08-31
| |\ \ \ \ | | |/ / / | |/| | | feat(lua): vim.ui_attach to get ui events from lua
| | * | | feat(lua): vim.ui_attach to get ui events from luabfredl2022-08-31
| | | | | | | | | | | | | | | | | | | | Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
| * | | | refactor: replace char_u with charDundar Göc2022-08-31
| |/ / / | | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | | fix(exceptions): restore `did_throw` (#20000)Sean Dewar2022-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false` is sometimes used to defer exception handling for later (without forgetting the exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred to a different call (e.g: when `try_level > 0`). In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of `did_throw = false`, but also causes the pending exception to be lost, which also leaks as `discard_exception()` wasn't used. It may be possible to fix this by saving/restoring `current_exception`, but handling all of `did_throw`'s edge cases seems messier. Maybe not worth diverging over. This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown due to Windows missing `man`, but they're lost; skip these tests if `man` isn't executable.
| * | | refactor: replace char_u with char 4 (#19987)dundargoc2022-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * | | refactor: replace char_u with charDundar Göc2022-08-29
| | | | | | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | | vim-patch:8.2.1269: language and locale code spread out (#19964)zeertzjq2022-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Language and locale code spread out. Solution: Move relevant code to src/locale.c. (Yegappan Lakshmanan, closes vim/vim#6509) https://github.com/vim/vim/commit/054f14bbe58fece17f1a74ca63f0b37518f0b4de Also remove redundant <locale.h> includes.
| * | | refactor: replace char_u with charDundar Göc2022-08-26
| | | | | | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | | refactor: change FALSE/TRUE to false/trueLewis Russell2022-08-26
| | | | | | | | | | | | | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * | | refactor: replace char_u with charDundar Goc2022-08-25
| | | | | | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | | refactor: suppress clang and PVS warnings (#19940)zeertzjq2022-08-25
| | | |
| * | | Merge pull request #19906 from bfredl/bigstagebfredl2022-08-24
| |\ \ \ | | | | | | | | | | perf(api): allow to use an arena for return values
| | * | | perf(api): allow to use an arena for return valuesbfredl2022-08-23
| | | |/ | | |/|
| * / | feat(eval)!: make Vim functions return inner window width and height (#19743)zeertzjq2022-08-24
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | In non-multigrid UI the only change is that the returned height now excludes winbar, and this is compatible with Vim. In multigrid UI this means the return value of these functions now reflect the space available for buffer lines in a window. No change in nvim_win_get_height() and nvim_win_get_width().
* | | Merge remote-tracking branch 'upstream/master' into usermarksJosh Rahm2022-08-22
|\| |
| * | vim-patch:8.2.4753: error from setting an option is silently ignored (#19888)zeertzjq2022-08-22
| | | | | | | | | | | | | | | Problem: Error from setting an option is silently ignored. Solution: Handle option value errors better. Fix uses of N_(). https://github.com/vim/vim/commit/31e5c60a682840959cae6273ccadd9aae48c928d
| * | vim-patch:8.2.2289: Vim9: 'cpo' can become empty (#19887)zeertzjq2022-08-22
| |/ | | | | | | | | | | | | | | Problem: Vim9: 'cpo' can become empty. Solution: Use empty_option instead of an empty string. Update quickfix buffer after restoring 'cpo'. (closes vim/vim#7608) https://github.com/vim/vim/commit/e5a2dc87fd9d63dfd0d9c379e363ee8b8c05b14c Omit test as it is Vim9 script.
* / feat(usermarks) getpos() now works for multibyte marksJosh Rahm2022-08-22
|/
* vim-patch:8.1.1886: command line expansion code is spread out (#19861)zeertzjq2022-08-21
| | | | | Problem: Command line expansion code is spread out. Solution: Move the code to cmdexpand.c. (Yegappan Lakshmanan, closes vim/vim#4831) https://github.com/vim/vim/commit/66b51420e0c8d49bcf6786b792c938d6099e3393
* vim-patch:8.1.2045: the option.c file is too big (#19854)zeertzjq2022-08-20
| | | | | | | | | | | Problem: The option.c file is too big. Solution: Split off the code dealing with strings. (Yegappan Lakshmanan, closes vim/vim#4937) https://github.com/vim/vim/commit/dac1347b4d9c1a1aef6aa73fdea08a9d1077d6ea Cherry-pick set_string_option_direct_in_win() from patch 8.1.1405. Cherry-pick shift_line() comment change from patch 8.1.2096. Move 'clipboard' default parsing to didset_string_options(). Reorder option flags to put Nvim-only flags at the end.
* fix(eval): check for v:lua when calling callback (#19855)zeertzjq2022-08-20
| | | This makes callback_call() match call_vim_function() when calling a function.
* vim-patch:8.1.1966: some code in options.c fits better elsewhere (#19840)zeertzjq2022-08-19
| | | | | | Problem: Some code in options.c fits better elsewhere. Solution: Move functions from options.c to other files. (Yegappan Lakshmanan, closes vim/vim#4889) https://github.com/vim/vim/commit/e677df8d93772a705f40a94f3c871aee78fe4d99
* refactor(eval.c): resolve all clint issues (#19774)Lewis Russell2022-08-16
|
* vim-patch:8.1.1869: code for the argument list is spread out (#19791)zeertzjq2022-08-16
| | | | | | Problem: Code for the argument list is spread out. Solution: Put argument list code in arglist.c. (Yegappan Lakshmanan, closes vim/vim#4819) https://github.com/vim/vim/commit/4ad62155a1015751a6645aaecd94b02c94c8934b
* vim-patch:8.2.0061: the execute stack can grow big and never shrinkszeertzjq2022-08-14
| | | | | | Problem: The execute stack can grow big and never shrinks. Solution: Reduce the size in gargage collect. https://github.com/vim/vim/commit/3fbcc128cbd2311819cc5a7bb89e45669860f008
* refactor: change remaining sourcing_name/sourcing_lnum to exestackzeertzjq2022-08-14
| | | | Co-Authored-By: VVKot <volodymyr.kot.ua@gmail.com>
* vim-patch:8.2.0056: execution stack is incomplete and inefficientzeertzjq2022-08-14
| | | | | | | | | | | Problem: Execution stack is incomplete and inefficient. Solution: Introduce a proper execution stack and use it instead of sourcing_name/sourcing_lnum. Create a string only when used. https://github.com/vim/vim/commit/1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506 Omit test_debugger.vim: superseded by later patches. Omit check_map_keycodes(): N/A. Omit kword_test.c: N/A (converted to a unit test).
* refactor: remove some unused includes (#19747)zeertzjq2022-08-13
| | | | | - Remove autocmd.h from fileio.h - Remove normal.h from main.h - Move bufinfo_T from undo_defs.h to undo.c
* refactor: remove some unused includes (#19740)zeertzjq2022-08-12
| | | | Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other headers.
* refactor: replace char_u with charDundar Goc2022-08-12
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: move non-symbols in ex_eval.h to ex_eval_defs.h (#19739)zeertzjq2022-08-12
| | | | This avoids including ex_eval.h in any other header, thus preventing future circular includes.
* vim-patch:8.1.1689: profiling code is spread outzeertzjq2022-08-12
| | | | | | | Problem: Profiling code is spread out. Solution: Move more profiling code to profiler.c. (Yegappan Lakshmanan, closes vim/vim#4668) https://github.com/vim/vim/commit/660a10ad41c14363326f83451c3c425201923119
* vim-patch:8.1.1684: profiling functionality is spread outzeertzjq2022-08-12
| | | | | | | | | Problem: Profiling functionality is spread out. Solution: Put profiling functionality in profiling.c. (Yegappan Lakshmanan, closes vim/vim#4666) https://github.com/vim/vim/commit/fa55cfc69d2b14761e2a8bd85bc1e0d82df770aa Move proftime_T to types.h for now to avoid recursive #include.
* refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)zeertzjq2022-08-11
| | | | | | | vim-patch:8.2.0559: clearing a struct is verbose Problem: Clearing a struct is verbose. Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER(). https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
* vim-patch:8.1.1823: command line history code is spread out (#19688)zeertzjq2022-08-09
| | | | | | Problem: Command line history code is spread out. Solution: Put the code in a new file. (Yegappan Lakshmanan, closes vim/vim#4779) Also graduate the +cmdline_hist feature. https://github.com/vim/vim/commit/d7663c22c6c1ff0f86b81371586fbc851d3a3e9e
* vim-patch:8.2.1281: the "trailing characters" error can be hard to understandzeertzjq2022-08-07
| | | | | | Problem: The "trailing characters" error can be hard to understand. Solution: Add the trailing characters to the message. https://github.com/vim/vim/commit/2d06bfde29bd3a62fc85823d2aa719ef943bd319
* vim-patch:9.0.0092: plugins cannot change v:completed_item (#19542)zeertzjq2022-07-28
| | | | | | Problem: Plugins cannot change v:completed_item. Solution: Make v:completed_item writeable. (Shougo Matsushita, closes vim/vim#10801) https://github.com/vim/vim/commit/61021aa318ca4c4a6b0182ee93388b2e9b5eefba