| Commit message (Collapse) | Author | Age |
... | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#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
|
| |
| |
| | |
Co-authored-by: marvim <marvim@users.noreply.github.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#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
|
| |
| |
| |
| | |
:filetype detect should enable filetype detection when it hasn't been
enabled before.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
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.
|
| |\
| | |
| | | |
refactor(shada): rework msgpack decoding without msgpack-c
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
- 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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
https://github.com/vim/vim/commit/f10911e5db16f1fe6ab519c5d091ad0c1df0d063
Also cherry-pick E1142 and E1156 tags from Vim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Coverity warning after 9.1.0440
Solution: Fix Coverity warning, add a test and
reduce the calls to clear_tv()
(Yegappan Lakshmanan).
closes: vim/vim#14845
https://github.com/vim/vim/commit/dbac0da631c66869f41c3c573ad7a8cfef95964d
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Some functions are not tested
Solution: Add a few more tests, fix a few minor problems
(Yegappan Lakshmanan)
closes: vim/vim#14789
https://github.com/vim/vim/commit/fe424d13ef6e5486923f23f15bb6951e3079412e
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: too long functions in eval.c
Solution: refactor functions (Yegappan Lakshmanan)
closes: vim/vim#14755
https://github.com/vim/vim/commit/4ceb4dc825854032eed423ec1fc372317d3420bf
Skip the eval_expr_typval() changes.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Cannot use a method with a complex expression.
Solution: Evaluate the expression after "->" and use the result.
https://github.com/vim/vim/commit/c665dabdf4c49a0fbf1dc566253c75c2abe2effa
Cherry-pick a "verbose" check from patch 8.2.4123.
N/A patches for version.c:
vim-patch:8.2.4102: Vim9: import cannot be used after method
vim-patch:8.2.4110: Coverity warns for using NULL pointer
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Vim9: assign test fails.
Solution: Add missing change.
https://github.com/vim/vim/commit/f24f51d03035379cf3e5b2dccf489a40bc4ca92a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Vim9: cannot use += to append to empty NULL list.
Solution: Copy the list instead of extending it. (closes vim/vim#6998)
https://github.com/vim/vim/commit/81ed4960482f8baabdd7f95b4d5e39744be88ae7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
case-insensitive
Problem: regex: wrong match when searching multi-byte char
case-insensitive (diffsetter)
Solution: Apply proper case-folding for characters and search-string
This patch does the following 4 things:
1) When the regexp engine compares two utf-8 codepoints case
insensitive it may match an adjacent character, because it assumes
it can step over as many bytes as the pattern contains.
This however is not necessarily true because of case-folding, a
multi-byte UTF-8 character can be considered equal to some
single-byte value.
Let's consider the pattern 'ſ' and the string 's'. When comparing and
ignoring case, the single character 's' matches, and since it matches
Vim will try to step over the match (by the amount of bytes of the
pattern), assuming that since it matches, the length of both strings is
the same.
However in that case, it should only step over the single byte value
's' by 1 byte and try to start matching after it again. So for the
backtracking engine we need to ensure:
* we try to match the correct length for the pattern and the text
* in case of a match, we step over it correctly
There is one tricky thing for the backtracing engine. We also need to
calculate correctly the number of bytes to compare the 2 different
utf-8 strings s1 and s2. So we will count the number of characters in
s1 that the byte len specified. Then we count the number of bytes to
step over the same number of characters in string s2 and then we can
correctly compare the 2 utf-8 strings.
2) A similar thing can happen for the NFA engine, when skipping to the
next character to test for a match. We are skipping over the regstart
pointer, however we do not consider the case that because of
case-folding we may need to adjust the number of bytes to skip over.
So this needs to be adjusted in find_match_text() as well.
3) A related issue turned out, when prog->match_text is actually empty.
In that case we should try to find the next match and skip this
condition.
4) When comparing characters using collections, we must also apply case
folding to each character in the collection and not just to the
current character from the search string. This doesn't apply to the
NFA engine, because internally it converts collections to branches
[abc] -> a\|b\|c
fixes: vim/vim#14294
closes: vim/vim#14756
https://github.com/vim/vim/commit/22e8e12d9f5034e1984db0c567b281fda4de8dd7
N/A patches:
vim-patch:9.0.1771: regex: combining chars in collections not handled
vim-patch:9.0.1777: patch 9.0.1771 causes problems
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Illegal memory access when pattern starts with illegal byte.
Solution: Do not match a character with an illegal byte.
https://github.com/vim/vim/commit/f50940531dd57135fe60aa393ac9d3281f352d88
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Unnecessary STRLEN() when applying mapping.
(after v9.1.0642)
Solution: Use m_keylen and vim_strnsave().
(zeertzjq)
closes: vim/vim#15394
https://github.com/vim/vim/commit/74011dc1fa7bca6c901937173a42e0edce68e080
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
Variables are often assigned multiple places in common patterns.
Solution:
Replace these common patterns with different patterns that reduce the
number of assignments.
Use `MAX` and `MIN`:
```c
if (x < y) {
x = y;
}
// -->
x = MAX(x, y);
```
```c
if (x > y) {
x = y;
}
// -->
x = MIN(x, y);
```
Use ternary:
```c
int a;
if (cond) {
a = b;
} els {
a = c;
}
// -->
int a = cond ? b : c;
```
|
| |
| |
| |
| |
| |
| |
| |
| | |
closes: vim/vim#13753
https://github.com/vim/vim/commit/49cdd629a39d7e40e7349e65cb177e2442871a04
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
|