aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
Commit message (Collapse)AuthorAge
* Change from char_u to charfix_repeatcmdlineJosh Rahm2023-11-29
|
* Merge remote-tracking branch 'upstream/master' into fix_repeatcmdlineJosh Rahm2023-11-29
|\
| * 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
| |
| * build(lint): remove unnecessary clint.py rulesdundargoc2023-10-23
| | | | | | | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py.
| * vim-patch:9.0.2050: Vim9: crash with deferred function call and exception ↵zeertzjq2023-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#25715) Problem: Vim9: crash with deferred function call and exception Solution: Save and restore exception state Crash when a deferred function is called after an exception and another exception is thrown closes: vim/vim#13376 closes: vim/vim#13377 https://github.com/vim/vim/commit/c59c1e0d88651a71ece7366e418f1253abbe2a28 The change in check_due_timer() is N/A as Nvim calls timer callbacks on the main loop. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
| * vim-patch:9.0.2044: Vim9: exceptions confuse defered functionszeertzjq2023-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: exceptions confuse defered functions Solution: save and restore exception state when calling defered functions closes: vim/vim#13364 closes: vim/vim#13372 https://github.com/vim/vim/commit/0672595fd50e9ae668676a40e28ebf66d7f52392 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
| * refactor(options): rename `empty_option` to `empty_string_option`Famiu Haque2023-10-17
| |
| * refactor(options)!: make OptionSet `v:` values use typvalFamiu Haque2023-10-17
| | | | | | | | BREAKING CHANGE: This breaks the OptionSet autocommand, as the `v:` values associated with it (`v:option_new`, `v:option_old`, `v:option_oldlocal` and `v:option_oldglobal`) are now the same type as the option, instead of all option values being converted to strings.
| * refactor(options): unify set_num_option and set_bool_optionFamiu Haque2023-10-17
| |
| * vim-patch:9.0.2033: gcc overflow-warning for f_resolve (#25666)zeertzjq2023-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: gcc overflow-warning for f_resolve Solution: use pointer p instead of pointer q[-1] Suppress the following warning: ``` filepath.c: In function ‘f_resolve’: filepath.c:2162:27: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 2162 | q[-1] = NUL; ``` Closes: vim/vim#13352 closes: vim/vim#13353 https://github.com/vim/vim/commit/215c3261a25f7a99e8711a3b3c6158119c6aea9e Co-authored-by: Ken Takata <kentkt@csc.jp>
| * vim-patch:8.2.3064: Vim9: in script cannot set item in uninitialized list ↵zeertzjq2023-10-12
| | | | | | | | | | | | | | | | | | | | (#25605) Problem: Vim9: in script cannot set item in uninitialized list. Solution: When a list is NULL allocate an empty one. (closes vim/vim#8461) https://github.com/vim/vim/commit/e65081d1b591f16dc6e380a830d87565c5eb7b03 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: allow not having a `default` case for enumFamiu Haque2023-10-10
| | | | | | | | | | | | Problem: The style guide states that all switch statements that are not conditional on an enum must have a `default` case, but does not give any explicit guideline for switch statements that are conditional on enums. As a result, a `default` case is added in many enum switch statements, even when the switch statement is exhaustive. This is not ideal because it removes the ability to have compiler errors to easily detect unchanged switch statements when a new possible value for an enum is added. Solution: Add explicit guidelines for switch statements that are conditional on an enum, clarifying that a `default` case is not necessary if the switch statement is exhaustive. Also refactor pre-existing code with unnecessary `default` cases.
| * refactor: the long goodbyedundargoc2023-10-09
| | | | | | | | | | | | 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.
| * refactor(grid): get rid of unbatched grid_puts and grid_putcharbfredl2023-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This finalizes the long running refactor from the old TUI-focused grid implementation where text-drawing cursor was not separated from the visible cursor. Still, the pattern of setting cursor position together with updating a line was convenient. Introduce grid_line_cursor_goto() to still allow this but now being explicit about it. Only having batched drawing functions makes code involving drawing a bit longer. But it is better to be explicit, and this highlights cases where multiple small redraws can be grouped together. This was the case for most of the changed places (messages, lastline, and :intro)
| * feat: ignore swapfile for running Nvim processes #25336Justin M. Keyes2023-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The swapfile "E325: ATTENTION" dialog is displayed when editing a file already open in another (running) Nvim. Usually this behavior is annoying and irrelevant: - "Recover" and the other options ("Open readonly", "Quit", "Abort") are almost never wanted. - swapfiles are less relevant for "multi-Nvim" since 'autoread' is enabled by default. - Even less relevant if user enables 'autowrite'. Solution: Define a default SwapExists handler which does the following: 1. If the swapfile is owned by a running Nvim process, automatically chooses "(E)dit anyway" (caveat: this creates a new, extra swapfile, which is mostly harmless and ignored except by `:recover` or `nvim -r`. 2. Shows a 1-line "ignoring swapfile..." message. 3. Users can disable the default SwapExists handler via `autocmd! nvim_swapfile`.
| * refactor: the long goodbyedundargoc2023-10-03
| | | | | | | | | | | | 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.