aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* fix(api): error properly with invalid field in nvim_open_win (#30078)zeertzjq2024-08-17
|
* vim-patch:9.1.0677: :keepp does not retain the substitute patternzeertzjq2024-08-17
| | | | | | | | | | | | | Problem: :keeppatterns does not retain the substitute pattern for a :s command Solution: preserve the last substitute pattern when used with the :keeppatterns command modifier (Gregory Anders) closes: vim/vim#15497 https://github.com/vim/vim/commit/3b59be4ed8a145d3188934f1a5cd85432bd2433d Co-authored-by: Gregory Anders <greg@gpanders.com>
* vim-patch:9.1.0679: Rename from w_closing to w_locked is incompletezeertzjq2024-08-17
| | | | | | | | | | | Problem: Rename from w_closing to w_locked is incomplete (after 9.1.0678). Solution: Rename remaining occurrences of w_closing to w_locked and update comments (zeertzjq). closes: vim/vim#15504 https://github.com/vim/vim/commit/bc11f6d9d4f580179d3963f3c489881904d6cd62
* vim-patch:9.1.0678: [security]: use-after-free in alist_add()zeertzjq2024-08-17
| | | | | | | | | | | | | Problem: [security]: use-after-free in alist_add() (SuyueGuo) Solution: Lock the current window, so that the reference to the argument list remains valid. This fixes CVE-2024-43374 https://github.com/vim/vim/commit/0a6e57b09bc8c76691b367a5babfb79b31b770e8 Co-authored-by: Christian Brabandt <cb@256bit.org>
* feat(diff): do not try external when out of memoryLewis Russell2024-08-15
| | | | - Also merge diff_buf_idx_tp into diff_buf_idx.
* feat(term): support OSC 8 hyperlinks in :terminal (#30050)Gregory Anders2024-08-15
|
* fix(highlight): fix the seg fault caused by the invalid linked hl idsWilliam Wong2024-08-14
|
* refactor(fileio): use os_copy() to copy file (#30030)zeertzjq2024-08-13
| | | | It uses sendfile(), which is faster than combining read() and write(), and it also copies permissions.
* vim-patch:9.1.0672: marker folds may get corrupted on undo (#30026)zeertzjq2024-08-11
| | | | | | | | | | | | | Problem: marker folds may get corrupted on undo (Yousef Mohammed) Solution: when adjusting folds, make sure that line1 is the lower limit and line2 is the upper line limit. In particular, line2 should not be able to get smaller than line1. fixes: vim/vim#15455 closes: vim/vim#15466 https://github.com/vim/vim/commit/8d02e5cf961b06da5bc490ac5972bcbc252c4793 Co-authored-by: Christian Brabandt <cb@256bit.org>
* test(lsp): refactor and tidyLewis Russell2024-08-11
| | | | | | | - Merge all the top level 'LSP' describe blocks - Refactor text edit tests - Fix typing errors - Add linebreaks between tests
* feat(term): enable reflow by default (#21124)Christian Clason2024-08-10
| | | | | | | | | | | | Problem: Contents of terminal buffer are not reflown when Nvim is resized. Solution: Enable reflow in libvterm by default. Now that libvterm is vendored, also fix "TUI rapid resize" test failures there. Note: Neovim's scrollback buffer does not support reflow (yet), so lines vanishing into the buffer due to a too small window will be restored without reflow.
* build(deps): vendor libvterm at v0.3.3Christian Clason2024-08-10
| | | | | | | | Problem: Adding support for modern Nvim features (reflow, OSC 8, full utf8/emoji support) requires coupling libvterm to Nvim internals (e.g., utf8proc). Solution: Vendor libvterm at v0.3.3.
* vim-patch:9.1.0667: Some other options reset curswant unnecessarily when set ↵zeertzjq2024-08-10
| | | | | | | | | | | | | (#30020) Problem: Some other options reset curswant unnecessarily when set. (Andrew Haust) Solution: Don't reset curswant when setting 'comments', 'commentstring' or 'define' (zeertzjq) fixes: vim/vim#15462 closes: vim/vim#15467 https://github.com/vim/vim/commit/b026a293b1e9d7a30f7717e256fe5f7f1dfa20d7
* vim-patch:9.1.0666: assert_equal() doesn't show multibyte string correctly ↵zeertzjq2024-08-10
| | | | | | | | | | | (#30018) Problem: assert_equal() doesn't show multibyte string correctly Solution: Properly advance over a multibyte char. (zeertzjq) closes: vim/vim#15456 https://github.com/vim/vim/commit/9c4b2462bb498f44044616f7309d111d12170369
* docs: update version.c (#30016)github-actions[bot]2024-08-09
| | | Co-authored-by: marvim <marvim@users.noreply.github.com>
* vim-patch:0cc5dce: runtime(doc): clarify directory of Vim's executable vs CWDzeertzjq2024-08-09
| | | | | | | | | | According to :h win32-PATH, "the same directory as Vim" means the same directory as the Vim executable, not Vim's current directory. In patch 8.2.4860 these two concepts were mixed up. closes: vim/vim#15451 https://github.com/vim/vim/commit/0cc5dce5780d39fe621f6146d4fb862318918125
* vim-patch:8.2.4860: MS-Windows: always uses current directory for executableszeertzjq2024-08-09
| | | | | | | | | | | | Problem: MS-Windows: always uses current directory for executables. Solution: Check the NoDefaultCurrentDirectoryInExePath environment variable. (Yasuhiro Matsumoto, closes vim/vim#10341) https://github.com/vim/vim/commit/05cf63e9bdca1ac070df3e7d9c6dfc45e68ac916 Omit doc change: override in later doc update. Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
* vim-patch:8.1.1413: error when the drive of the swap file was disconnected ↵zeertzjq2024-08-08
| | | | | | | | | | (#30009) Problem: Error when the drive of the swap file was disconnected. Solution: Try closing and re-opening the swap file. (closes vim/vim#4378) https://github.com/vim/vim/commit/b58a4b938c4bc7e0499700859bd7abba9acc5b11 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3476: renaming a buffer on startup may cause using freed memoryzeertzjq2024-08-08
| | | | | | | | | | | Problem: Renaming a buffer on startup may cause using freed memory. Solution: Check if the buffer is used in a window. (closes vim/vim#8955) https://github.com/vim/vim/commit/d3710cf01ef6ab1b2f233866ff01dab76686f642 Cherry-pick Test_echo_true_in_cmd() from Vim. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor!: use utf8proc full casefoldingdundargoc2024-08-07
| | | | | | | | | | | | | | | | | | | | According to `CaseFolding-15.1.0.txt`, full casefolding should be preferred over simple casefolding as it's considered to be more correct. Since utf8proc already provides full casefolding it makes sense to switch to it. This will also remove a lot of unnecessary build code. Temporary exceptions are made for two sets characters: - `ß` will still be considered `ß` (instead of `ss`) as using a full casefolding requires interfering with upstream spell files in some form. - `İ` will still be considered `İ` (instead of `i̇`) as using full casefolding requires making a value judgement on the "correct" behavior. There are two, equally valid case-insensetive comparison for this character according to unicode. It is essentially up to the implementor to decide which conversion is correct. For this reason it might make sense to allow users to decide which conversion should be done as an added option to `casemap` in a future PR.
* vim-patch:partial:8.1.0914: code related to findfile() is spread out (#30000)zeertzjq2024-08-07
| | | | | | | | | | Problem: Code related to findfile() is spread out. Solution: Put findfile() related code into a new source file. (Yegappan Lakshmanan, closes vim/vim#3934) https://github.com/vim/vim/commit/5fd0f5052f9a312bb4cfe7b4176b1211d45127ee Keep functions related to wildcard expansion in path.c, as in Vim they are now spread out among multiple files, which isn't really ideal.
* vim-patch:9.1.0662: filecopy() may return wrong value when readlink() fails ↵zeertzjq2024-08-07
| | | | | | | | | | | (#29998) Problem: filecopy() may return wrong value when readlink() fails. Solution: Set ret to -1 so that 0 is returned when readlink() fails. (zeertzjq) closes: vim/vim#15438 https://github.com/vim/vim/commit/da090f95df6c015e4f7fc9e1036795a370503a83
* fix(filetype): fix :filetype detect error with -u NONE (#29991)zeertzjq2024-08-06
| | | | :filetype detect should enable filetype detection when it hasn't been enabled before.
* vim-patch:8.2.4838: checking for absolute path is not trivial (#29990)zeertzjq2024-08-06
| | | | | | | | | | Problem: Checking for absolute path is not trivial. Solution: Add isabsolutepath(). (closes vim/vim#10303) https://github.com/vim/vim/commit/dca1d40cd0f2af0755519e7028378bd3c8fefd31 vim-patch:8a3b805c6c9c Co-authored-by: LemonBoy <thatlemon@gmail.com>
* vim-patch:9.1.0465: missing filecopy() function (#29989)zeertzjq2024-08-06
| | | | | | | | | | | Problem: missing filecopy() function Solution: implement filecopy() Vim script function (Shougo Matsushita) closes: vim/vim#12346 https://github.com/vim/vim/commit/60c8743ab6c90e402e6ed49d27455ef7e5698abe Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* refactor: extract eval/fs.c from eval/funcs.c (#29985)zeertzjq2024-08-06
| | | | | | In Vim a lot of filesystem functions have been moved to filepath.c. However, some of these functions actually deal with file contents, and Nvim's filesystem-related functions are spread out in a different way. Therefore, it's better to use a different file for these functions.
* Merge pull request #29540 from bfredl/neoshadabfredl2024-08-05
|\ | | | | refactor(shada): rework msgpack decoding without msgpack-c
| * build(deps): remove msgpack-c dependencybfredl2024-08-05
| |
| * refactor(shada): rework msgpack decoding without msgpack-cbfredl2024-08-05
| | | | | | | | | | | | | | This also makes shada reading slightly faster due to avoiding some copying and allocation. Use keysets to drive decoding of msgpack maps for shada entries.
* | fix(build): surpress spurious warnings from gcc in -E preprocessor modebfredl2024-08-05
|/ | | | | | | | | | | | | Since #29315 we are also preprocessing header files in order to find functions which need prototype declarations. gcc emits a spurious "warning: #pragma once in main file" even when when you are just using `gcc -E` which causes a bit of noise in compiler output. As a workaround, surpress all warnings for this step, this should be pretty much harmless as we will still get preprocessor warnings when doing actual compilation `gcc -c` later. reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89808
* vim-patch:9.1.0653: Patch v9.1.0648 not completely rightzeertzjq2024-08-03
| | | | | | | | | | | | Problem: Patch v9.1.0648 not completely right (zeertzjq) Solution: Remove always true condition closes: vim/vim#15415 https://github.com/vim/vim/commit/a0b5bc12850f1d87fa51fb7be42df0ea835ccf21 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.0648: [security] double-free in dialog_changed()zeertzjq2024-08-03
| | | | | | | | | | | | | | | | | Problem: [security] double-free in dialog_changed() (SuyueGuo) Solution: Only clear pointer b_sfname pointer, if it is different than the b_ffname pointer. Don't try to free b_fname, set it to NULL instead. fixes: vim/vim#15403 Github Advisory: https://github.com/vim/vim/security/advisories/GHSA-46pw-v7qw-xc2f https://github.com/vim/vim/commit/b29f4abcd4b3382fa746edd1d0562b7b48c9de60 Co-authored-by: Christian Brabandt <cb@256bit.org>
* refactor: move some functions out of eval.c (#29964)zeertzjq2024-08-02
| | | | | | - common_function() has always been in evalfunc.c in Vim - return_register() has always been in evalfunc.c in Vim - get_user_input() was moved to ex_getln.c in Vim 8.1.1957 - tv_get_lnum_buf() was moved to typval.c in Vim 8.2.0847
* fix(tui): reset active attr ID when OSC 8 sequence is terminated (#29960)Gregory Anders2024-08-02
| | | | | | | | | | | | When the cursor is moved we terminate any active OSC 8 sequences to prevent the sequence from inadvertently spanning regions it is not meant to span. However, if we do not also reset the TUI's active attr id (print_attr_id) then the TUI does not "know" that it's current attribute set has changed. When cursor_goto is called to wrap a line, the TUI does not recompute the attributes so the OSC 8 sequence is not restarted again. When we terminate an OSC 8 sequence before moving the cursor, also reset the active attr id so that the attributes are recomputed for URLs.
* fix(eval): handle wrong v:lua in expr option properly (#29953)zeertzjq2024-08-02
|
* refactor(eval): treat v:lua call as simple functionzeertzjq2024-08-02
|
* vim-patch:9.1.0649: Wrong comment for "len" argument of call_simple_func()zeertzjq2024-08-02
| | | | | | | | | | Problem: Wrong comment for "len" argument of call_simple_func(). Solution: Remove the "or -1 to use strlen()". Also change its type to size_t to remove one cast. (zeertzjq) closes: vim/vim#15410 https://github.com/vim/vim/commit/c1ed788c1b41db9b5f1ef548dc877f771f535bbe
* vim-patch:9.0.0634: evaluating "expr" options has more overhead than neededzeertzjq2024-08-02
| | | | | | | | | | | | | | | | | | Problem: Evaluating "expr" options has more overhead than needed. Solution: Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr', "expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr', 'formatexpr', 'indentexpr' and 'charconvert'. https://github.com/vim/vim/commit/a4e0b9785e409e9e660171cea76dfcc5fdafad9b vim-patch:9.0.0635: build error and compiler warnings Problem: Build error and compiler warnings. Solution: Add missing change. Add type casts. https://github.com/vim/vim/commit/3292a229402c9892f5ab90645fbfe2b1db342f5b Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0632: calling a function from an "expr" option has overheadzeertzjq2024-08-02
| | | | | | | | | | | | Problem: Calling a function from an "expr" option has too much overhead. Solution: Add call_simple_func() and use it for 'foldexpr' https://github.com/vim/vim/commit/87b4e5c5db9d1cfd6f2e79656e1a6cff3c69d15f Cherry-pick a call_func() change from patch 8.2.1343. Add expr-option-function docs to options.txt. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4416: Vim9: using a script-local function requires using "s:" ↵zeertzjq2024-08-02
| | | | | | | | | | | | | | | | | | (#29950) Problem: Vim9: using a script-local function requires using "s:" when setting 'completefunc'. Solution: Do not require "s:" in Vim9 script. (closes vim/vim#9796) https://github.com/vim/vim/commit/1fca5f3e86f08e696058fc7e86dfe41b415a78e6 vim-patch:8.2.4417: using NULL pointer Problem: Using NULL pointer. Solution: Set offset after checking for NULL pointer. https://github.com/vim/vim/commit/e89bfd212b21c227f026e467f882c62cdd6e642d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.0652: too many strlen() calls in syntax.c (#29949)zeertzjq2024-08-02
| | | | | | | | | | | | Problem: too many strlen() calls in syntax.c Solution: refactor code to reduce the number or strlen() calls, get rid of un-used SYN_NAMELEN macro (John Marriott) closes: vim/vim#15368 https://github.com/vim/vim/commit/b4ea77185c7deeb6f7c8d5aa14f8c97a097e5dee Co-authored-by: John Marriott <basilisk@internode.on.net>
* vim-patch:9.1.0651: ex: trailing dot is optional for :g and :insert/:append ↵zeertzjq2024-08-02
| | | | | | | | | | | | | | | | (#29946) Problem: ex: trailing dot is optional for :g and :insert/:append Solution: don't break out early, when the next command is empty. (Mohamed Akram) The terminating period is optional for the last command in a global command list. closes: vim/vim#15407 https://github.com/vim/vim/commit/0214680a8ec5f7f656cb42e5db19243709202ed2 Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
* vim-patch:9.1.0647: [security] use-after-free in tagstack_clear_entryzeertzjq2024-08-02
| | | | | | | | | | | | | | | | | | | Problem: [security] use-after-free in tagstack_clear_entry (Suyue Guo ) Solution: Instead of manually calling vim_free() on each of the tagstack entries, let's use tagstack_clear_entry(), which will also free the stack, but using the VIM_CLEAR macro, which prevents a use-after-free by setting those pointers to NULL This addresses CVE-2024-41957 Github advisory: https://github.com/vim/vim/security/advisories/GHSA-f9cr-gv85-hcr4 https://github.com/vim/vim/commit/8a0bbe7b8aad6f8da28dee218c01bc8a0185a2d5 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.0650: Coverity warning in cstrncmp() (#29944)zeertzjq2024-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Coverity warning in cstrncmp() (after v9.1.0645) Solution: Change the type of n2 to int. (zeertzjq) ________________________________________________________________________________________________________ *** CID 1615684: Integer handling issues (INTEGER_OVERFLOW) /src/regexp.c: 1757 in cstrncmp() 1751 n1 -= mb_ptr2len(s1); 1752 MB_PTR_ADV(p); 1753 n2++; 1754 } 1755 // count the number of bytes to advance the same number of chars for s2 1756 p = s2; >>> CID 1615684: Integer handling issues (INTEGER_OVERFLOW) >>> Expression "n2--", which is equal to 18446744073709551615, where "n2" is known to be equal to 0, underflows the type that receives it, an unsigned integer 64 bits wide. 1757 while (n2-- > 0 && *p != NUL) 1758 MB_PTR_ADV(p); 1759 1760 n2 = p - s2; 1761 1762 result = MB_STRNICMP2(s1, s2, *n, n2); closes: vim/vim#15409 https://github.com/vim/vim/commit/e8feaa354e685e527198093904492f67c52c2302
* vim-patch:8.2.4275: cannot use an autoload function from a package under ↵zeertzjq2024-08-01
| | | | | | | | | | | | | | | | | start (#29937) Problem: Cannot use an autoload function from a package under start. Solution: Also look in the "start" package directory. (Bjorn Linse, closes vim/vim#7193) https://github.com/vim/vim/commit/223a950a85448253780da4e821a5b23dcdfad28f Nvim already does this in do_in_cached_path(), and this change has no effect in Nvim as Nvim removes DIP_START after do_in_cached_path(). Accidentally failed to mark as ported: vim-patch:8.2.1731: Vim9: cannot use += to append to empty NULL list Co-authored-by: bfredl <bjorn.linse@gmail.com>
* vim-patch:partial:f10911e: Update runtime files (#29936)zeertzjq2024-08-01
| | | | | | | https://github.com/vim/vim/commit/f10911e5db16f1fe6ab519c5d091ad0c1df0d063 Also cherry-pick E1142 and E1156 tags from Vim. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:partial:9.1.0462: eval5() and eval7 are too complexzeertzjq2024-08-01
| | | | | | | | | | | | Problem: eval5() and eval7 are too complex Solution: Refactor eval5() and eval7() in eval.c (Yegappan Lakshmanan) closes: vim/vim#14900 https://github.com/vim/vim/commit/734286e4c626f80ace27eeb252a5e384e798aebf Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:partial:9.1.0450: evalc. code too complexzeertzjq2024-08-01
| | | | | | | | | | | | Problem: eval.c code too complex Solution: refactor eval6() and eval9() functions into several smaller functions (Yegappan Lakshmanan) closes: vim/vim#14875 https://github.com/vim/vim/commit/51c45e89b50a4841147b9fbd7c6095ab79a10c71 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* fix(scrollbind): properly take filler/virtual lines into accountLewis Russell2024-07-31
| | | | | | | | | | | | | | | | | | Problem: `'scrollbind'` does not work properly if the window being scrolled automatically contains any filler/virtual lines (except for diff filler lines). This is because when the scrollbind check is done, the logic only considers changes to topline which are represented as line numbers. Solution: Write the logic for determine the scroll amount to take into account filler/virtual lines. Fixes #29751
* vim-patch:9.1.0411: too long functions in eval.c (#29925)zeertzjq2024-07-31
| | | | | | | | | | | | Problem: too long functions in eval.c Solution: refactor functions (Yegappan Lakshmanan) closes: vim/vim#14755 https://github.com/vim/vim/commit/4ceb4dc825854032eed423ec1fc372317d3420bf The remaining eval_expr_typval() changes. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>