aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
Commit message (Collapse)AuthorAge
* Merge branch 'userreg' into 20231130_mixJosh Rahm2023-11-30
|\
| * Merge remote-tracking branch 'origin/usermarks' into HEADJosh Rahm2023-11-30
| |\
| | * Merge remote-tracking branch 'upstream/master' into usermarksusermarksJosh Rahm2023-01-25
| | |\
| | * | feat(usermarks): add usermarks to f_has listJosh Rahm2022-08-21
| | | |
| * | | Merge remote-tracking branch 'upstream/master' into userreguserregJosh Rahm2023-11-29
| |\ \ \
| * \ \ \ Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2023-01-25
| |\ \ \ \ | | | |_|/ | | |/| |
| * | | | Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2022-10-11
| |\ \ \ \
| * | | | | 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 branch 'fix_repeatcmdline' into 20231130_mixJosh Rahm2023-11-30
|\ \ \ \ \
| * | | | | Change from char_u to charfix_repeatcmdlineJosh Rahm2023-11-29
| | | | | |
| * | | | | Merge remote-tracking branch 'upstream/master' into fix_repeatcmdlineJosh Rahm2023-11-29
| |\ \ \ \ \ | | | |_|_|/ | | |/| | |
| * | | | | Merge remote-tracking branch 'upstream/master' into fix_repeatcmdlineJosh Rahm2023-01-25
| |\ \ \ \ \ | | | |_|_|/ | | |/| | |
| * | | | | eval/userfunc.c: save the repeat_cmdline along with the redo buffJosh Rahm2022-09-15
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | A user function can clobber the repeat_cmdline, which is used to build the redo buffer, thus, if the redo buffer is saved when calling a userfunc, so should the repeat_cmdline.
* | | | | refactor(IWYU): move typedefs out of globals.h (#26322)zeertzjq2023-11-30
| | | | |
* | | | | 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.
* | | | refactor: fix headers with IWYUdundargoc2023-11-28
| | | |
* | | | refactor: move hashtab types to hashtab_defs.h (#26262)zeertzjq2023-11-28
| | | |
* | | | refactor: fix runtime_defs.h (#26259)zeertzjq2023-11-28
| | | |
* | | | refactor: rename types.h to types_defs.hdundargoc2023-11-27
| | | |
* | | | build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
| | | |
* | | | build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
| | | |
* | | | build: enable IWYU on macdundargoc2023-11-27
| | | |
* | | | build(IWYU): replace most private mappings with pragmas (#26247)zeertzjq2023-11-27
| | | |
* | | | refactor: remove vim.h from more headers (#26244)zeertzjq2023-11-27
| | | |
* | | | docs: small fixes (#26154)dundargoc2023-11-27
| | | |
* | | | refactor: move Arena and ArenaMem to memory_defs.h (#26240)zeertzjq2023-11-27
| | | |
* | | | build(IWYU): replace public-to-public mappings with pragmas (#26237)zeertzjq2023-11-27
| | | |
* | | | refactor: move garray_T to garray_defs.h (#26227)zeertzjq2023-11-26
| | | |
* | | | 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.
* | | | vim-patch:8.2.4685: when a swap file is found for a popup there is no dialog ↵zeertzjq2023-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#26207) Problem: When a swap file is found for a popup there is no dialog and the buffer is loaded anyway. Solution: Silently load the buffer read-only. (closes vim/vim#10073) https://github.com/vim/vim/commit/188639d75c363dffaf813e8e2209f7350ad1e871 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | | | refactor: remove __clang_analyzer__ macrodundargoc2023-11-21
| | | | | | | | | | | | | | | | | | | | It is less intrusive to silence the warning with a comment instead of a macro if needed.
* | | | build: adjust clang-tidy warning exclusion logicdundargoc2023-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable all clang-tidy warnings by default instead of disabling them. This ensures that we don't miss useful warnings on each clang-tidy version upgrade. A drawback of this is that it will force us to either fix or adjust the warnings as soon as possible.
* | | | 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: follow style guidedundargoc2023-11-19
| | | | | | | | | | | | | | | | | | | | - reduce variable scope - prefer initialization over declaration and assignment
* | | | Merge pull request #25724 from luukvbaal/signmergebfredl2023-11-18
|\ \ \ \ | | | | | | | | | | refactor(sign): move legacy signs to extmarks
| * | | | refactor(sign): move legacy signs to extmarksLuuk van Baal2023-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
* | | | | 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.
* | | | | refactor: iwyu (#26062)zeertzjq2023-11-16
| | | | |
* | | | | refactor: move some functions to winfloat.c (#26020)Raphael2023-11-16
|/ / / /
* | | | fix(textformat): remove unnecessary changed_bytes() (#26027)zeertzjq2023-11-13
| | | | | | | | | | | | This was removed from Vim in patch 8.1.0681.
* | | | refactor: replace manual header guards with #pragma oncedundargoc2023-11-12
| | | | | | | | | | | | | | | | | | | | It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard.
* | | | 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.
* | | | refactor: remove redundant castsdundargoc2023-11-11
| | | |
* | | | 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
| | | |
* | | | refactor: change some xstrndup() and xstrnsave() to xmemdupz() (#25959)zeertzjq2023-11-10
| | | | | | | | | | | | | | | | When the given length is exactly the number of bytes to copy, xmemdupz() makes the intention clearer.
* | | | fix(job-control): make jobwait() flush UI after hiding cursor (#25927)zeertzjq2023-11-08
| | | |
* | | | refactor: the long goodbyedundargoc2023-11-05
| | | | | | | | | | | | | | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
* | | | vim-patch:9.0.2070: [security] disallow setting env in restricted mode (#25807)zeertzjq2023-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security] disallow setting env in restricted mode Solution: Setting environment variables in restricted mode could potentially be used to execute shell commands. Disallow this. restricted mode: disable allow setting of environment variables Setting environment variables in restricted mode, may have some unwanted consequences. So, for example by setting $GCONV_PATH in restricted mode and then calling the iconv() function, one may be able to execute some unwanted payload, because the `iconv_open()` function internally uses the `$GCONV_PATH` variable to find its conversion data. So let's disable setting environment variables, even so this is no complete protection, since we are not clearing the existing environment. I tried a few ways but wasn't successful :( One could also argue to disable the iconv() function completely in restricted mode, but who knows what other API functions can be influenced by setting some other unrelated environment variables. So let's leave it as it is currently. closes: vim/vim#13394 See: https://huntr.com/bounties/b0a2eda1-459c-4e36-98e6-0cc7d7faccfe/ https://github.com/vim/vim/commit/6b89dd6a7257a1e2e9c7ea070b407bc4674a5118 Co-authored-by: Christian Brabandt <cb@256bit.org>
* | | | fix(terminal): assign channel to terminal earlier (#25771)zeertzjq2023-10-25
| | | |