aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
| * | | | | | | build: rework formatting to use add_glob_targetdundargoc2023-12-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will ensure that we can pass flags and make adjustments from the top level cmake file instead of digging through the cmake directory. More importantly, this will only format files that have been changed. This has a slightly higher initial cost compared to previous solution as all files must be initially formatted, but the gained speed up should more than make up for it quickly. `make formatlua` is always run due to a quirk of stylua of always changing modification time of the file regardless if there were any changes. This is not a major blocker as stylua is very fast.
| * | | | | | | refactor(terminal): only remove const qualifier when necessary (#26386)zeertzjq2023-12-04
| | | | | | | |
| * | | | | | | refactor(completion): use an inline function to free cptext (#26380)Raphael2023-12-04
| | | | | | | |
| * | | | | | | vim-patch:9.0.2145: wrong scrolling in insert mode with smoothscroll (#26375)zeertzjq2023-12-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Wrong scrolling in Insert mode with 'smoothscroll' at the bottom of the window. Solution: Don't use set_topline() when 'smoothscroll' is set. fixes: vim/vim#13612 closes: vim/vim#13613 https://github.com/vim/vim/commit/5b4d1fcbf06757bae32a894871b9a649c84eba7f
| * | | | | | | Merge pull request #26334 from echasnovski/default-colorschemezeertzjq2023-12-03
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | feat(highlight): update default color scheme
| | * | | | | | | feat(highlight): update default color schemeEvgeni Chasnovski2023-12-02
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Default color scheme is suboptimal. Solution: Start using new color scheme. Introduce new `vim` color scheme for opt-in backward compatibility. ------ Main design ideas - Be "Neovim branded". - Be minimal for 256 colors with a bit more shades for true colors. - Be accessible through high enough contrast ratios. - Be suitable for dark and light backgrounds via exchange of dark and light palettes. ------ Palettes - Have dark and light variants. Implemented through exporeted `NvimDark*` and `NvimLight*` hex colors. - Palettes have 4 shades of grey for UI elements and 6 colors (red, yellow, green, cyan, blue, magenta). - Actual values are computed procedurally in Oklch color space based on a handful of hyperparameters. - Each color has a 256 colors variant with perceptually closest color. ------ Highlight groups Use: - Grey shades for general UI according to their design. - Bold text for keywords (`Statement` highlight group). This is an important choice to increase accessibility for people with color deficiencies, as it doesn't rely on actual color. - Green for strings, `DiffAdd` (as background), `DiagnosticOk`, and some minor text UI elements. - Cyan as main syntax color, i.e. for function usage (`Function` highlight group), `DiffText`, `DiagnosticInfo`, and some minor text UI elements. - Red to generally mean high user attention, i.e. errors; in particular for `ErrorMsg`, `DiffDelete`, `DiagnosticError`. - Yellow very sparingly only with true colors to mean mild user attention, i.e. warnings. That is, `DiagnosticWarn` and `WarningMsg`. - Blue very sparingly only with true colors as `DiagnosticHint` and some additional important syntax group (like `Identifier`). - Magenta very carefully (if at all). ------ Notes - To make tests work without relatively larege updates, each one is prepended with an equivalent of the call `:colorscheme vim`. Plus some tests which spawn new Neovim instances also now use 'vim' color scheme. In some cases tests are updated to fit new default color scheme.
| * / / / / / / refactor: remove unused file ringbuf.hdundargoc2023-12-02
| |/ / / / / /
| * | | | | | vim-patch:9.0.2143: [security]: buffer-overflow in ex_substitutezeertzjq2023-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security]: buffer-overflow in ex_substitute Solution: clear memory after allocating When allocating the new_start pointer in ex_substitute() the memory pointer points to some garbage that the following for loop in ex_cmds.c:4743 confuses and causes it to accessing the new_start pointer beyond it's size, leading to a buffer-overlow. So fix this by using alloc_clear() instead of alloc(), which will clear the memory by NUL and therefore cause the loop to terminate correctly. Reported by @henices, thanks! closes: vim/vim#13596 https://github.com/vim/vim/commit/abfa13ebe92d81aaf66669c428d767847b577453 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * | | | | | vim-patch:9.0.2142: [security]: stack-buffer-overflow in option callback ↵zeertzjq2023-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions Problem: [security]: stack-buffer-overflow in option callback functions Solution: pass size of errbuf down the call stack, use snprintf() instead of sprintf() We pass the error buffer down to the option callback functions, but in some parts of the code, we simply use sprintf(buf) to write into the error buffer, which can overflow. So let's pass down the length of the error buffer and use sprintf(buf, size) instead. Reported by @henices, thanks! https://github.com/vim/vim/commit/b39b240c386a5a29241415541f1c99e2e6b8ce47 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * | | | | | vim-patch:9.0.2141: [security]: buffer-overflow in suggest_trie_walkzeertzjq2023-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security]: buffer-overflow in suggest_trie_walk Solution: Check n before using it as index into byts array Basically, n as an index into the byts array, can point to beyond the byts array. So let's double check, that n is within the expected range after incrementing it from sp->ts_curi and bail out if it would be invalid. Reported by @henices, thanks! https://github.com/vim/vim/commit/0fb375aae608d7306b4baf9c1f906961f32e2abf Co-authored-by: Christian Brabandt <cb@256bit.org>
| * | | | | | vim-patch:9.0.2140: [security]: use-after-free in win-enterzeertzjq2023-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security]: use-after-free in win-enter Solution: validate window pointer before calling win_enter() win_goto() may stop visual mode, if it is active. However, this may in turn trigger the ModeChanged autocommand, which could potentially free the wp pointer which was valid before now became stale and points to now freed memory. So before calling win_enter(), let's verify one more time, that the wp pointer still points to a valid window structure. Reported by @henices, thanks! https://github.com/vim/vim/commit/eec0c2b3a4cfab93dd8d4adaa60638d47a2bbc8a Co-authored-by: Christian Brabandt <cb@256bit.org>
| * | | | | | revert: "memory: Free buffers after freeing variables" (#26356)zeertzjq2023-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fe30d8ccef17fff23676b8670dfec86444e2cb32. The original commit intends to prevent heap-use-after-free with EXITFREE caused by changedtick_di, which is no longer a problem. Freeing buffers after freeing variables will cause heap-use-after-free with EXITFREE when a partial is used as prompt callback.
| * | | | | | refactor: free more reachable memory with EXITFREE (#26349)zeertzjq2023-12-02
| | | | | | | | | | | | | | | | | | | | | Discovered using __sanitizer_print_memory_profile().
| * | | | | | refactor: remove kbtree.hdundargoc2023-12-01
| | | | | | |
| * | | | | | refactor: remove SIZEOF_INT checkdundargoc2023-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have not seen any indication that this is a problem tha can occur with cmake.
| * | | | | | refactor: move float_relative_str[] to nvim_win_get_config() (#26344)zeertzjq2023-12-01
| | | | | | | | | | | | | | | | | | | | | It's only used in one place, as it's usually conveyed as non-string.
| * | | | | | refactor: change event_create() to a macro (#26343)zeertzjq2023-12-01
| | | | | | | | | | | | | | | | | | | | | A varargs functions can never be inlined, so a macro is faster.
| * | | | | | fix(api): use a conditional stack for nvim_cmd (#26341)zeertzjq2023-12-01
| | | | | | |
| * | | | | | refactor(IWYU): fix includes for highlight_group.h (#26340)zeertzjq2023-12-01
| | | | | | |
| * | | | | | refactor(IWYU): create {ex_getln,rbuffer,os/fileio}_defs.h (#26338)zeertzjq2023-12-01
| | | | | | |
| * | | | | | fix(termkey): include IO header on WindowsGregory Anders2023-11-30
| | | | | | |
| * | | | | | fix(termkey): accept BEL (0x07) as OSC terminatorGregory Anders2023-11-30
| | | | | | |
| * | | | | | fix(termkey): do not sign extend mode valueGregory Anders2023-11-30
| | | | | | |
| * | | | | | build: vendor libtermkeydundargoc2023-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a proof of concept/WIP to evaluate the viability of vendoring libtermkey as it's been deprecated.
| * | | | | | refactor: explicitly abort on OOM condition (#26330)Gregory Anders2023-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | assert() would not abort in release builds, meaning an OOM condition would be undetected.
| * | | | | | refactor(IWYU): fix includes for cmdhist.h (#26324)zeertzjq2023-11-30
| | | | | | |
| * | | | | | fix(tui): grow termkey's internal buffer for large escape sequences (#26309)Gregory Anders2023-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some escape sequences (in particular, OSC 52 paste responses) can be very large, even unbounded in length. These can easily overflow termkey's internal buffer. In order to process these long sequences, dynamically grow termkey's internal buffer.
| * | | | | | refactor(IWYU): move typedefs out of globals.h (#26322)zeertzjq2023-11-30
| | | | | | |
| * | | | | | Merge pull request #23657 from luukvbaal/extmarkbfredl2023-11-30
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | fix(extmark): restore extmarks when completing original text
| | * | | | | | fix(extmark): restore extmarks when completing original textLuuk van Baal2023-11-29
| | | |_|_|/ / | | |/| | | |
| * | | | | | refactor: move extern variables out of _defs.h files (#26320)zeertzjq2023-11-30
| | | | | | |
| * | | | | | refactor(IWYU): move UI and LineFlags to ui_defs.h (#26318)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.
| * | | | | | fix(terminal): make backslashes in 'shell' work on WindowsLuki4462023-11-30
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | If backslashes are used in 'shell' option, escape them to make Terminal mode work.
* | | | | | Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpostJosh Rahm2023-11-30
|\| | | | |
| * | | | | refactor: move function macros out of vim_defs.h (#26300)zeertzjq2023-11-29
| | | | | |
| * | | | | refactor: move some constants out of vim_defs.h (#26298)zeertzjq2023-11-29
| | | | | |
| * | | | | perf(column): only invalidate lines affected by added signLuuk van Baal2023-11-29
| | | | | |
| * | | | | Merge pull request #26292 from luukvbaal/decorbfredl2023-11-29
| |\ \ \ \ \ | | | | | | | | | | | | | | fix(decorations): do not apply sign highlight id as range attr id
| | * | | | | fix(decorations): do not apply sign highlight id as range attr idLuuk van Baal2023-11-29
| | | | | | |
| * | | | | | vim-patch:9.0.2134: ml_get error when scrolling (#26264)zeertzjq2023-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ml_get error when scrolling after delete Solution: mark topline to be validated in main_loop if it is larger than current buffers line count reset_lnums() is called after e.g. TextChanged autocommands and it may accidentally cause curwin->w_topline to become invalid, e.g. if the autocommand has deleted some lines. So verify that curwin->w_topline points to a valid line and if not, mark the window to have w_topline recalculated in main_loop() in update_topline() after reset_lnums() returns. fixes: vim/vim#13568 fixes: vim/vim#13578 https://github.com/vim/vim/commit/c4ffeddfe5bd1824650e9b911ed9245bf56c69e3 The error doesn't happen in Nvim because Nvim triggers TextChanged after calling update_topline(). Co-authored-by: Christian Brabandt <cb@256bit.org>
| * | | | | | refactor(IWYU): create normal_defs.h (#26293)zeertzjq2023-11-29
| |/ / / / /
| * | | | | vim-patch:9.0.2136: MSVC errorformat can be improved (#26283)zeertzjq2023-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: MSVC errorformat can be improved Solution: parse error type and column number in MSVC errorformat closes: vim/vim#13587 https://github.com/vim/vim/commit/8ceb99001b52d0c642e7532763ec9d8217ee86e3 Co-authored-by: Shawn Hatori <shawn.hatori@gmail.com>
| * | | | | vim-patch:9.0.2135: No test for mode() when executing Ex commands (#26282)zeertzjq2023-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No test for mode() when executing Ex commands Solution: Add some test cases and simplify several other test cases. Also add a few more test cases for ModeChanged. closes: vim/vim#13588 https://github.com/vim/vim/commit/fcaeb3d42b228e73c669b2fce78f1d3fe112769f
| * | | | | refactor: fix headers with IWYUdundargoc2023-11-28
| | | | | |
| * | | | | refactor(decor): remove sign conditions that are always trueLuuk van Baal2023-11-28
| | | | | |
| * | | | | fix(column): redraw and update signcols for paired extmarkLuuk van Baal2023-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Signcolumn width does not increase when ranged sign does not start at sentinel line. Solution: Handle paired range of added sign when checking signcols.
| * | | | | refactor: iwyu (#26269)zeertzjq2023-11-28
| | | | | |
| * | | | | Merge pull request #26249 from bfredl/concealcharbfredl2023-11-28
| |\ \ \ \ \ | | | | | | | | | | | | | | feat(decoration): allow conceal_char to be a composing char
| | * | | | | feat(decoration): allow conceal_char to be a composing charbfredl2023-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | decor->text.str pointer must go. This removes it for conceal char, in preparation for a larger PR which will also handle the sign case. By actually allowing composing chars for a conceal chars, this becomes a feature and not just a refactor, as a bonus.