Commit Graph

6657 Commits

Author SHA1 Message Date
Lewis Russell
84bbe4b0ca fix(lua): disallow vim.wait() in fast contexts
`vim.wait()` cannot be called in a fast callback since the main loop
cannot be run in that context as it is not reentrant

Fixes #26122
2023-11-27 09:09:21 +00:00
Christian Clason
38e98754a5 vim-patch:9.0.2128: runtime(swig): add syntax and filetype plugins
Add syntax and filetype plugins for SWIG (Simplified Wrapper Interface
Generator) description files.

The default syntax for .i files highlights comments in a reverse
color scheme which doesn't look well.  This syntax builds
on vim's c++ syntax by adding highlighting for common swig
directives and user defined directives.  For an alternative
syntax, see vimscript vim/vim#1247 (which I found after writing this).

closes: vim/vim#13562

2e31065a65

Co-authored-by: Julien Marrec <julien.marrec@gmail.com>
Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2023-11-26 00:41:59 +01:00
James McCoy
0da62b579f
Merge pull request #26203 from jamessan/swapfile-test-fix
fix(oldtest): always use a 64-bit int for swapfile block number
2023-11-25 07:08:27 -05:00
luukvbaal
6a2a37b1e1
fix(mouse): avoid dragging when clicking next to popupmenu (#26201) 2023-11-25 07:10:19 +08:00
James McCoy
a1ded1b113
fix(oldtest): always use a 64-bit int for swapfile block number
09d4133 changed blocknr_T from long to int64_t, so pe_bnum is now always 64-bit.  This was an incompatible change in the swapfile format for 32-bit systems, but there have been no complaints in the past 9 years so just adjust the test.
2023-11-24 15:22:00 -05:00
zeertzjq
55dbf5c379
fix(messages): validate msg_grid before using msg_grid_pos (#26189) 2023-11-24 10:44:19 +08:00
luukvbaal
a8a93e517f
fix(mouse): avoid dragging after click label popupmenu callback (#26187) 2023-11-24 09:15:50 +08:00
zeertzjq
fe94e04893
vim-patch:9.0.2126: unused assignments when checking 'listchars' (#26182)
Problem:  Unused assignments when checking the value of 'listchars'.
Solution: Loop only once when just checking the value.  Add a test to
          check that this change doesn't cause double-free.

closes: vim/vim#13559

00624a2fa0
2023-11-24 06:52:50 +08:00
zeertzjq
9510346141
vim-patch:9.0.2125: File info disappears when 'cmdheight' has decreased (#26180)
Problem:  File info disappears immediately when 'cmdheight' has just
          decreased due to switching tabpage and 'shortmess' doesn't
          contain 'o' or 'O'.
Solution: Make sure msg_row isn't smaller than cmdline_row.

fixes: vim/vim#13560
closes: vim/vim#13561

40ed6711bd
2023-11-24 06:13:24 +08:00
Luuk van Baal
df399ea0d2 fix(column): reset decor state before starting from top 2023-11-23 16:27:17 +00:00
zeertzjq
b514edcdf4
test: remove the pipe created by new_pipename() (#26173) 2023-11-23 23:05:52 +08:00
luukvbaal
c126a3756a
fix(column): apply numhl signs when 'signcolumn' is "no" (#26167) 2023-11-23 19:58:17 +08:00
zeertzjq
8d8136bfcf vim-patch:9.0.2121: [security]: use-after-free in ex_substitute
Problem:  [security]: use-after-free in ex_substitute
Solution: always allocate memory

closes: vim/vim#13552

A recursive :substitute command could cause a heap-use-after free in Vim
(CVE-2023-48706).

The whole reproducible test is a bit tricky, I can only reproduce this
reliably when no previous substitution command has been used yet
(which is the reason, the test needs to run as first one in the
test_substitute.vim file) and as a combination of the `:~` command
together with a :s command that contains the special substitution atom `~\=`
which will make use of a sub-replace special atom and calls a vim script
function.

There was a comment in the existing :s code, that already makes the
`sub` variable allocate memory so that a recursive :s call won't be able
to cause any issues here, so this was known as a potential problem
already.  But for the current test-case that one does not work, because
the substitution does not start with `\=` but with `~\=` (and since
there does not yet exist a previous substitution atom, Vim will simply
increment the `sub` pointer (which then was not allocated dynamically)
and later one happily use a sub-replace special expression (which could
then free the `sub` var).

The following commit fixes this, by making the sub var always using
allocated memory, which also means we need to free the pointer whenever
we leave the function. Since sub is now always an allocated variable,
we also do no longer need the sub_copy variable anymore, since this one
was used to indicated when sub pointed to allocated memory (and had
therefore to be freed on exit) and when not.

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-c8qm-x72m-q53q

26c11c5688

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-23 16:17:37 +08:00
Luuk van Baal
c249058758 feat(extmarks): add sign name to extmark "details" array
Problem:  Unable to identify legacy signs when fetching extmarks with
          `nvim_buf_get_extmarks()`.
Solution: Add "sign_name" to the extmark detail array.

Add some misc. changes as follow-up to #25724
2023-11-22 12:43:59 +01:00
bfredl
fba17d5b88 fix(decorations): fix imbalanced sign count 2023-11-22 11:41:47 +01:00
bfredl
0b38fe4dbb refactor(decorations): break up Decoration struct into smaller pieces
Remove the monolithic Decoration struct. Before this change, each extmark
could either represent just a hl_id + priority value as a inline
decoration, or it would take a pointer to this monolitic 112 byte struct
which has to be allocated.

This change separates the decorations into two pieces: DecorSignHighlight
for signs, highlights and simple set-flag decorations (like spell,
ui-watched), and DecorVirtText for virtual text and lines.

The main separation here is whether they are expected to allocate more
memory. Currently this is not really true as sign text has to be an
allocated string, but the plan is to get rid of this eventually (it can
just be an array of two schar_T:s). Further refactors are expected to
improve the representation of each decoration kind individually. The
goal of this particular PR is to get things started by cutting the
Gordian knot which was the monolithic struct Decoration.

Now, each extmark can either contain chained indicies/pointers to
these kinds of objects, or it can fit a subset of DecorSignHighlight
inline.

The point of this change is not only to make decorations smaller in
memory. In fact, the main motivation is to later allow them to grow
_larger_, but on a dynamic, on demand fashion. As a simple example, it
would be possible to augment highlights to take a list of multiple
`hl_group`:s, which then would trivially map to a chain of multiple
DecorSignHighlight entries.

One small feature improvement included with this refactor itself, is
that the restriction that extmarks cannot be removed inside a decoration
provider has been lifted. These are instead safely lifetime extended
on a "to free" list until the current iteration of screen drawing is done.

NB: flags is a mess. but DecorLevel is useless, this slightly less so
2023-11-22 09:28:54 +01:00
Bara C. Tudor
91ef26dece
fix(messages): :map output with ext_messages (#26126) 2023-11-22 09:50:28 +08:00
zeertzjq
fec5e3ab24
fix(vim.region): handle multibyte inclusive selection properly (#26129) 2023-11-21 14:25:45 +08:00
luukvbaal
d667e0e414
vim-patch:9.0.2116: No test for defining sign without attribute (#26115)
Problem:  No test for defining sign without attribute
Solution: Add test for defining sign without attributes

closes: vim/vim#13544

e670d17342
2023-11-20 10:25:14 +08:00
Mathias Fußenegger
7ca2d64e8b
test: skip failing watch file tests on freebsd (#26110)
Quick fix as follow up to https://github.com/neovim/neovim/pull/26108

kqueue only reports events on a watched folder itself, not for files
created or deleted within. So the approach the PR took doesn't work on FreeBSD.

We'll either need to bring back polling for it, combine watching with manual
file tracking, or disable LSP file watching on FreeBSD
2023-11-19 18:37:49 +01:00
Mathias Fußenegger
de28a0f84c
perf(lsp): replace file polling on linux with per dir watcher (#26108)
Should help with https://github.com/neovim/neovim/issues/23291

On linux `new_fs_event` doesn't support recursive watching, but we can
still use it to watch folders.

The downside of this approach is that we may end up sending some false
`Deleted` events. For example, if you save a file named `foo` there will
be a intermediate `foo~` due to the save mechanism of neovim.

The events we get from vim.uv in that case are:

- rename: foo~
- rename: foo~
- rename: foo
- rename: foo
- change: foo
- change: foo

The mechanism in this PR uses a debounce to reduce this to:

- deleted: foo~
- changed: foo

`foo~` will be the false positive.
I suspect that for the LSP case this is good enough. If not, we may need
to follow up on this and keep a table in memory that tracks available
files.
2023-11-19 14:25:32 +01:00
bfredl
df87266b23
Merge pull request #25724 from luukvbaal/signmerge
refactor(sign): move legacy signs to extmarks
2023-11-18 15:04:14 +01:00
Raphael
cdc8bacc79
fix(completion): filter results with complete+=f (#26029) 2023-11-18 12:26:52 +08:00
Maria José Solano
4972c80489 refactor(snippet): rename test utilities 2023-11-17 17:10:27 +01:00
Maria José Solano
7e36c8e972 feat(lsp): support for choice snippet nodes 2023-11-17 17:10:27 +01:00
zeertzjq
ad867fee26
fix(tui): handle cursor visibility properly (#26091)
The test is for the case without 'termsync' because libvterm doesn't
support synchronized output, and it passes without this PR.
2023-11-17 22:13:30 +08:00
Luuk van Baal
c4afb9788c refactor(sign): move legacy signs to extmarks
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.
2023-11-17 15:10:15 +01:00
bfredl
b522cb1ac3 refactor(grid): make screen rendering more multibyte than ever before
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.
2023-11-17 12:58:57 +01:00
zeertzjq
790bd4d585 vim-patch:9.0.2106: [security]: Use-after-free in win_close()
Problem:  [security]: Use-after-free in win_close()
Solution: Check window is valid, before accessing it

If the current window structure is no longer valid (because a previous
autocommand has already freed this window), fail and return before
attempting to set win->w_closing variable.

Add a test to trigger ASAN in CI

25aabc2b8e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:59:22 +08:00
zeertzjq
d49be1cd28 vim-patch:9.0.2010: [security] use-after-free from buf_contents_changed()
Problem:  [security] use-after-free from buf_contents_changed()
Solution: block autocommands

41e6f7d6ba

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:59:22 +08:00
zeertzjq
b6200fbdf2 vim-patch:9.0.1992: [security] segfault in exmode
Problem:  segfault in exmode when redrawing
Solution: skip gui_scroll when exmode_active

20d161ace3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:59:22 +08:00
zeertzjq
3ab0e296c6 vim-patch:9.0.1969: [security] buffer-overflow in trunc_string()
Problem:  buffer-overflow in trunc_string()
Solution: Add NULL at end of buffer

Currently trunc_string() assumes that when the string is too long,
buf[e-1] will always be writeable. But that assumption may not always be
true. The condition currently looks like this

    else if (e + 3 < buflen)
    [...]
    else
    {
	// can't fit in the "...", just truncate it
	buf[e - 1] = NUL;
    }

but this means, we may run into the last else clause with e still being
larger than buflen. So a buffer overflow occurs.

So instead of using `buf[e - 1]`, let's just always
truncate at `buf[buflen - 1]` which should always be writable.

3bd7fa12e1

vim-patch:9.0.2004: Missing test file

Problem:  Missing test file
Solution: git-add the file to the repo

closes: vim/vim#13305

d4afbdd071

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:59:16 +08:00
zeertzjq
5a67878e86 vim-patch:9.0.1882: Trailing white space in tests
Problem:  Trailing white space in tests
Solution: Delete it

This causes test_codestyle to fail, so we need to remove it again.
Hopefully that makes the CI green again.

Note: I will start using annotated tags from now on.

da200c2f78

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
7f62775d5d vim-patch:9.0.1881: Test_crash fails on Mac
Problem:  Test_crash fails on Mac
Solution: Skip test on Mac

5856b07795

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
b5b6e6fb49 vim-patch:9.0.1878: tests running sh have problems
Problem:  tests running sh have problems
Solution: Check that dash is installed

closes: vim/vim#13040

1690ec64ff

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
eae10de14e vim-patch:9.0.1873: [security] heap-buffer-overflow in vim_regsub_both
Problem:  heap-buffer-overflow in vim_regsub_both
Solution: Disallow exchanging windows when textlock is active

f6d28fe2c9

Cherry-pick test_crash.vim change from patch 9.0.1876.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
6867d2492c vim-patch:9.0.1872: CI: test_crash() fails on CI
Problem:  CI: test_crash() fails on CI
Solution: Skip test on BSD

d2a08ba0fa

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
0b0df9f5d7 vim-patch:9.0.1868: test_crash still fails for circle ci
Problem:  test_crash still fails for circle ci
Solution: give even more time to complete

59adcb4c20

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
1274380029 vim-patch:9.0.1864: still crash with bt_quickfix1_poc
Problem:  crash with bt_quickfix1_poc when cleaning up
          and EXITFREE is defined
Solution: Test if buffer is valid in a window, else close
          window directly, don't try to access buffer properties

While at it, increase the crash timeout slightly, so that CI has a
chance to finish processing the test_crash() test.

623ba31821

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
2371b9303d vim-patch:9.0.1860: CI: test_crash1() is flaky
Problem:  CI: test_crash1() is flaky
Solution: Wait a bit longer

f44cbe96fa

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
bbb363f4bc vim-patch:partial:9.0.1859: heap-use-after-free in bt_normal()
Problem:  heap-use-after-free in bt_normal()
Solution: check that buffer is still valid

6e60cf444a

Test change only.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
8dc72789cf vim-patch:9.0.1858: [security] heap use after free in ins_compl_get_exp()
Problem:  heap use after free in ins_compl_get_exp()
Solution: validate buffer before accessing it

ee9166eb3b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
a589156b4d vim-patch:9.0.1857: [security] heap-use-after-free in is_qf_win()
Problem:  heap-use-after-free in is_qf_win()
Solution: Check buffer is valid before accessing it

fc68299d43

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
748198f5bf vim-patch:9.0.1854: test_crash1() fails on CI
Problem:  test_crash1() fails on CI
Solution: don't run Screendump test, verify that it doesn't crash
          by running it through a shell command line, testing
          the exit value and concatenating success cmd using '&&'

db510ca805

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
zeertzjq
6952b1951b
vim-patch:9.0.2107: [security]: FPE in adjust_plines_for_skipcol (#26082)
Problem:  [security]: FPE in adjust_plines_for_skipcol
Solution: don't divide by zero, return zero

Prevent a floating point exception when calculating w_skipcol (which can
happen with a small window when the number option is set and cpo+=n).

Add a test to verify

cb0b99f067

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 08:40:02 +08:00
zeertzjq
9d39ad6318 vim-patch:9.0.2111: [security]: overflow in get_number
Problem:  [security]: overflow in get_number
Solution: Return 0 when the count gets too large

[security]: overflow in get_number

When using the z= command, we may overflow the count with values larger
than MAX_INT. So verify that we do not overflow and in case when an
overflow is detected, simply return 0

73b2d3790c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 07:19:14 +08:00
zeertzjq
809b05bf27 vim-patch:9.0.2110: [security]: overflow in ex address parsing
Problem:  [security]: overflow in ex address parsing
Solution: Verify that lnum is positive, before substracting from
          LONG_MAX

[security]: overflow in ex address parsing

When parsing relative ex addresses one may unintentionally cause an
overflow (because LONG_MAX - lnum will overflow for negative addresses).

So verify that lnum is actually positive before doing the overflow
check.

060623e4a3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 07:16:04 +08:00
zeertzjq
016c6fae27 vim-patch:9.0.2109: [security]: overflow in nv_z_get_count
Problem:  [security]: overflow in nv_z_get_count
Solution: break out, if count is too large

When getting the count for a normal z command, it may overflow for large
counts given. So verify, that we can safely store the result in a long.

58f9befca1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 07:13:49 +08:00
zeertzjq
a4c111ae69 vim-patch:9.0.2108: [security]: overflow with count for :s command
Problem:  [security]: overflow with count for :s command
Solution: Abort the :s command if the count is too large

If the count after the :s command is larger than what fits into a
(signed) long variable, abort with e_value_too_large.

Adds a test with INT_MAX as count and verify it correctly fails.

It seems the return value on Windows using mingw compiler wraps around,
so the initial test using :s/./b/9999999999999999999999999990 doesn't
fail there, since the count is wrapping around several times and finally
is no longer larger than 2147483647. So let's just use 2147483647 in the
test, which hopefully will always cause a failure

ac63787734

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 07:06:52 +08:00
zeertzjq
354b57b01f vim-patch:9.0.1535: test commented out in a wrong way
Problem:    Test commented out in a wrong way.
Solution:   Use legacy script comment character.

a4467c433a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-17 07:06:52 +08:00
zeertzjq
f6658a1e78 vim-patch:9.0.1534: test for expanding "~" in substitute takes too long
Problem:    Test for expanding "~" in substitute takes too long.
Solution:   Disable the test for now.

916d6dd5b1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-17 07:06:52 +08:00
zeertzjq
d2f2e2725c vim-patch:9.0.1532: crash when expanding "~" in substitute causes very long text
Problem:    Crash when expanding "~" in substitute causes very long text.
Solution:   Limit the text length to MAXCOL.

ab9a2d884b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-17 07:06:52 +08:00
Gregory Anders
4bf47222c9
feat: add vim.text module (#26069) 2023-11-16 11:35:54 -06:00
luukvbaal
f4d95c05b9
vim-patch:9.0.2105: skipcol not reset when topline changed (#26042)
Problem:  Skipcol is not reset when topline changed scrolling cursor to top
Solution: reset skipcol

closes: vim/vim#13528

bb800a7907
2023-11-15 06:28:56 +08:00
Christian Clason
9e2248ab58 vim-patch:9.0.2104: wast filetype should be replaced by wat filetype
Problem:  wast filetype should be replaced by wat filetype
Solution: start using the official wat filetype name

runtime: rename `wast` filetype to `wat` (Wasm text format)

The problem is the name of the current filetype wast. When the plugin
was initially created, the file extension for Wasm text format was not
fixed and .wast was more popular.

However, recently .wat became the official file extension for
WebAssembly text (WAT) format and .wast is now a file extension for the
unofficial WAST format, which is a superset of .wat for the convenience
to describe the Wasm specification conformance tests.

https://webassembly.js.org/docs/contrib-wat-vs-wast.html

However for now, let's keep using the `wat` filetype even for the .wast
extension, so that we at least do not lose the filetype settings and
syntax highlighting. This can be adjusted later, if it turns out to have
a separate need for.

closes: vim/vim#13533

bc8f79d36a

Co-authored-by: rhysd <lin90162@yahoo.co.jp>
2023-11-14 21:51:28 +01:00
Gregory Anders
ac8ed77afb
feat(tui): add 'termsync' option (#25871)
The 'termsync' option enables a mode (provided the underlying terminal
supports it) where all screen updates during a redraw cycle are buffered
and drawn together when the redraw is complete. This eliminates tearing
or flickering in cases where Nvim redraws slower than the terminal
redraws the screen.
2023-11-14 08:53:58 -06:00
Ploum
5b45efbee6
fix(defaults): set 'fsync' #26034
Problem:
'nofsync' may lose data if the system has a hard shutdown. #9888

Solution:
Change default to 'fsync'. This may be revisited in the future when
'nofsync' can be made safer.
2023-11-14 02:56:50 -08:00
Gregory Anders
e7c46438ab test: use ST terminator instead of BEL in OSC sequences
libtermkey does not interpret OSC sequences that end with a BEL (0x07)
instead of an ST (0x1b 0x5c) terminator. This causes these tests to fail
since the OSC response is now parsed via libtermkey. Change the tests to
use the ST terminator to appease libtermkey.
2023-11-13 19:04:47 -06:00
Gregory Anders
8d9789a0f3 docs: deprecate the "term_background" UI field 2023-11-13 19:04:47 -06:00
Gregory Anders
ab102f188e refactor: move background color detection into Lua 2023-11-13 19:04:46 -06:00
zeertzjq
91872d7712
vim-patch:8.1.0970: text properties test fails when 'encoding' is not utf-8 (#26023)
Problem:    Text properties test fails when 'encoding' is not utf-8.
Solution:   Compare with original value of 'encoding'. (Christian Brabandt,
            closes vim/vim#3986)

ed79d1e348

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 15:01:40 +08:00
zeertzjq
c23c44f845 vim-patch:8.2.4850: mksession mixes up "tabpages" and "curdir" arguments
Problem:    Mksession mixes up "tabpages" and "curdir" arguments.
Solution:   Correct logic for storing tabpage in session. (closes vim/vim#10312)

d7c9564d8d

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-11-13 13:58:32 +08:00
zeertzjq
3d9593523d vim-patch:8.2.2112: running tests may leave some files behind
Problem:    Running tests may leave some files behind.
Solution:   Delete the right files.  Fix a few typos. (Dominique Pellé,
            closes vim/vim#7436

ac665c24c9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:50:43 +08:00
zeertzjq
0ff3187fb8 vim-patch:8.1.2373: cannot build with +popupwin but without +quickfix
Problem:    Cannot build with +popupwin but without +quickfix. (John Marriott)
Solution:   Adjust #ifdefs.

5a4c3082d7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:50:43 +08:00
zeertzjq
30d09d8258 vim-patch:8.1.2276: MS-Windows: session test leaves files behind
Problem:    MS-Windows: session test leaves files behind.
Solution:   Wipe out buffers before deleting the directory. (closes vim/vim#5187)

5bf46e9786

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:50:43 +08:00
zeertzjq
bcac7674f7 vim-patch:8.1.1581: shared functions for testing are disorganised
Problem:    Shared functions for testing are disorganised.
Solution:   Group finctions in script files. (Ozaki Kiichi, closes vim/vim#4573)

7a39dd7f00

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:50:43 +08:00
zeertzjq
538749410b vim-patch:partial:8.1.1218: cannot set a directory for a tab page
Problem:    Cannot set a directory for a tab page.
Solution:   Add the tab-local directory. (Yegappan Lakshmanan, closes vim/vim#4212)

00aa069db8

Session-related changes only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:29:57 +08:00
zeertzjq
36ce30be20 vim-patch:8.1.0870: Vim doesn't use the new ConPTY support in Windows 10
Problem:    Vim doesn't use the new ConPTY support in Windows 10.
Solution:   Use ConPTY support, if available. (Nobuhiro Takasaki, closes vim/vim#3794)

aa5df7e312

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:24:51 +08:00
zeertzjq
4872e2da3c vim-patch:partial:8.0.1592: terminal windows in a session are not properly restored
Problem:    Terminal windows in a session are not properly restored.
Solution:   Add "terminal" in 'sessionoptions'.  When possible restore the
            command running in a terminal.

4d8bac8bf5

Tests only. Nvim has no equivalent to "norestore" yet.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:22:54 +08:00
zeertzjq
748eae6bb5
test(old): reorder test_mksession.vim to match upstream (#26021) 2023-11-13 12:34:49 +08:00
luukvbaal
d3582e102b
feat(statuscolumn): re-evaluate for every screen line (#25885)
Problem:  v:virtnum is less useful than it could be.
Solution: Always re-evaluate 'statuscolumn', and update v:virtnum
          accordingly.
2023-11-13 11:24:02 +08:00
zeertzjq
2a58aa5709
vim-patch:9.0.2102: matchparen highlight not cleared in completion mode (#26019)
Problem:  matchparen highlight not cleared in completion mode
Solution: Clear matchparen highlighting in completion mode

Remove hard-coded hack in insexpand.c to clear the :3match before
displaying the completion menu.

Add a test for matchparen highlighting. While at it, move all test tests
related to the matchparen plugin into a separate test file.

closes: vim/vim#13493
closes: vim/vim#13524

9588666360

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-13 10:47:12 +08:00
zeertzjq
629f117945 vim-patch:9.0.0525: manually deleting temp test files
Problem:    Manually deleting temp test files.
Solution:   Add the 'D' flag to writefile().

5917341f65

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 09:34:39 +08:00
zeertzjq
b9cffe40fa vim-patch:9.0.0336: tests are flaky because of using a common file name
Problem:    Tests are flaky because of using a common file name.
Solution:   Rename files and directories to be more unique.

61abe7d8f8

Cherry-pick Test_custom_complete_autoload() from patch 8.2.4584.
Cherry-pick test_delete.vim & test_edit.vim changes from patch 9.0.0323.
Cherry-pick test_edit.vim changes from patch 8.2.3637.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 09:26:59 +08:00
zeertzjq
5c69f8569a vim-patch:9.0.0137: debugger test may fail when $CWD is very long
Problem:    Debugger test may fail when $CWD is very long.
Solution:   Skip the test if the directory name is too long. (James McCoy,
            closes vim/vim#10837)

db7a88db8b

Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-11-13 08:58:48 +08:00
zeertzjq
1fd0ded080
vim-patch:8.2.4809: various things no6 properly tested (#26017)
Problem:    Various things no6 properly tested.
Solution:   Add various test cases. (Yegappan Lakshmanan, closes vim/vim#10259)

885de449c0

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-11-13 08:55:25 +08:00
zeertzjq
d064f55704 vim-patch:8.2.4541: Crash in debugger when a variable is not available
Problem:    Crash in debugger when a variable is not available in the current
            block.
Solution:   Check for a NULL name. (closes vim/vim#9926)

e406ff87c8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 07:00:56 +08:00
zeertzjq
c5d4d1cc0d vim-patch:8.2.4020: debugger test fails
Problem:    Debugger test fails.
Solution:   Fix import statement.

84c62d59a3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:59:40 +08:00
zeertzjq
2503de4c92 vim-patch:8.2.3984: debugger test fails
Problem:    Debugger test fails.
Solution:   Adjust the test for modified debugging of a for loop.

3d0da09bb2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:59:10 +08:00
zeertzjq
331d213c0b vim-patch:8.2.3395: Vim9: expression breakpoint not checked in :def function
Problem:    Vim9: expression breakpoint not checked in :def function.
Solution:   Always compile a function for debugging if there is an expression
            breakpoint. (closes vim/vim#8803)

26a4484da2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:55:58 +08:00
zeertzjq
49d126e005 vim-patch:8.2.3138: debugger test fails
Problem:    Debugger test fails.
Solution:   Adjust eval command.

31e21766d6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:49:57 +08:00
zeertzjq
b313109a25 vim-patch:8.2.3116: Vim9: crash when debugging a function with line continuation
Problem:    Vim9: crash when debugging a function with line continuation.
Solution:   Check for a NULL pointer. (closes vim/vim#8521)

303215d60c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:49:40 +08:00
zeertzjq
310d0f15c0 vim-patch:8.2.3096: temp files remain after running tests
Problem:    Temp files remain after running tests.
Solution:   Delete the right files. (Dominique Pellé, closes vim/vim#8509)

6c72fd51a8

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-11-13 06:49:09 +08:00
zeertzjq
1cc2143710 vim-patch:8.2.3086: Vim9: breakpoint on "for" does not work
Problem:    Vim9: breakpoint on "for" does not work.
Solution:   Use the right line number in ISN_DEBUG. (closes vim/vim#8486)

6fc0161682

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:48:24 +08:00
zeertzjq
32012b3fe8 vim-patch:8.2.3066: Vim9: debugging lambda does not work
Problem:    Vim9: debugging lambda does not work.
Solution:   Use the compile type of the function when compiling a lambda.
            (closes vim/vim#8412)

17d868b8b2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:47:43 +08:00
zeertzjq
06acf78cd3 vim-patch:8.2.3039: Vim9: breakpoint at a comment line does not work
Problem:    Vim9: breakpoint at a comment line does not work.
Solution:   Add the comment line number to the debug instruction.
            (closes vim/vim#8429)

8cec9273d2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
zeertzjq
7e789137e9 vim-patch:8.2.3027: Vim9: breakpoint in compiled function not always checked
Problem:    Vim9: breakpoint in compiled function not always checked.
Solution:   Check for breakpoint when calling compiled function from compiled
            function.

2ac4b2536a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
zeertzjq
0bca5bff53 vim-patch:8.2.3026: Vim9: cannot set breakpoint in compiled function
Problem:    Vim9: cannot set breakpoint in compiled function.
Solution:   Check for breakpoint when calling a function.

4f8f54280f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
zeertzjq
940d9c59a7 vim-patch:8.2.3017: Vim9: debugger shows too many lines
Problem:    Vim9: debugger shows too many lines.
Solution:   Truncate at a comment, "enddef", etc. (closes vim/vim#8392)

59b50c3bee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
zeertzjq
02a43ddf1e vim-patch:8.2.3013: Vim: when debugging only first line of command is displayed
Problem:    Vim: when debugging only the first line of a command using line
            continuation is displayed.
Solution:   Find the next command and concatenate lines until that one.
            (closes vim/vim#8392)

4cea536bdf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
zeertzjq
d46b6b2978 vim-patch:8.2.3011: Vim9: cannot get argument values during debugging
Problem:    Vim9: cannot get argument values during debugging.
Solution:   Lookup names in the list of arguments.  Put debug instruction
            halfway for command.

6bc30b05e6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
zeertzjq
3e8541f4a0 vim-patch:8.2.3003: Vim9: closure compiled with wrong compile type
Problem:    Vim9: closure compiled with wrong compile type.
Solution:   Use COMPILE_TYPE() when calling a function. (closes vim/vim#8384)

968a5b62ff

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
zeertzjq
04d951685b vim-patch:8.2.2996: Vim9: when debugging cannot inspect local variables
Problem:    Vim9: when debugging cannot inspect local variables.
Solution:   Make local variables available when debugging.

b69c6fb7b4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
zeertzjq
5ce3b89ff3 vim-patch:8.2.2985: Vim9: a compiled function cannot be debugged
Problem:    Vim9: a compiled function cannot be debugged.
Solution:   Add initial debugging support.

e99d422bbd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
zeertzjq
74e23b3b2a
vim-patch:2dd613f57bf1 (#26009)
runtime(termdebug): improve the breakpoint sign label (vim/vim#13525)

// related vim/vim#12589
// that should be the last chat (I) with Bram, r.i.p

2dd613f57b

Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
2023-11-13 05:44:30 +08:00
dundargoc
353a4be7e8 build: remove PVS
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.
2023-11-12 21:26:39 +01:00
LW
448907f65d
feat(lsp)!: vim.lsp.inlay_hint.get(), enable(), is_enabled() #25512
refactor!: `vim.lsp.inlay_hint()` -> `vim.lsp.inlay_hint.enable()`

Problem:
The LSP specification allows inlay hints to include tooltips, clickable
label parts, and code actions; but Neovim provides no API to query for
these.

Solution:
Add minimal viable extension point from which plugins can query for
inlay hints in a range, in order to build functionality on top of.

Possible Next Steps
---

- Add `virt_text_idx` field to `vim.fn.getmousepos()` return value, for
  usage in mappings of `<LeftMouse>`, `<C-LeftMouse>`, etc
2023-11-12 04:54:27 -08:00
zeertzjq
ad3568a701
vim-patch:9.0.2101: CI: test_termdebug may still fail (#26003)
Problem:  CI: test_termdebug may still fail
Solution: use term_wait() to make it more robust

closes: vim/vim#13529

fdbadea4b6

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2023-11-12 18:18:28 +08:00
zeertzjq
9ecb43b637
fix(float): apply 'winblend' to title/footer highlight (#25999) 2023-11-12 09:23:34 +08:00
zeertzjq
145d9ed0fc
vim-patch:9.0.2100: CI: test_termdebug fails (#25997)
Problem:  CI: test_termdebug fails
Solution: only test for a changed winlayout, if the window
          width actually changed

Also, include an unrelated comment (which doesn't warrant its own patch
number)

305127f9f2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-12 08:18:40 +08:00
ObserverOfTime
c23dd7c9ef
vim-patch:9.0.2098: No filetype support for xcompose files (#25983)
Problem:  No filetype support for xcompose files
Solution: Add filetype detection

closes: vim/vim#13508

4f9074b96c
2023-11-12 07:51:25 +08:00
Christian Clason
84688ec372 vim-patch:9.0.2097: No support for cypher files
Problem:  No support for cypher files
Solution: Add cypher filetype detection

Cypher query language support to work with (mostly) graph databases.

Already existing lsp support in Neovim's nvim-lspconfig:
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#cypher_ls

closes: vim/vim#13516

8f0fe20ff1

Co-authored-by: Gerrit Meier <meistermeier@gmail.com>
2023-11-12 00:22:28 +01:00
zeertzjq
6c3e170e56
fix(highlight): apply 'winblend' to float border (#25981) 2023-11-11 15:12:58 +08:00
zeertzjq
fdaf6bc557
fix(context): don't leak memory on multiple invalid objects (#25979) 2023-11-11 13:10:26 +08:00
zeertzjq
e9b9a86cd5
fix(context): don't crash on invalid arg to nvim_get_context (#25977)
Note: The crash happens in the second test case when using uninitialized
memory, and therefore doesn't happen with ASAN.
2023-11-11 10:21:14 +08:00
mortezadadgar
d1b2a5cf5f
fix(completion): make sure the buffer name is valid (#25975)
Problem:
crash from
  set complete+=f
  open a empty buffer
  C-N

Solution:
make sure the buffer name is valid.

regression from ae4ca4edf8
2023-11-11 06:41:10 +08:00
dundargoc
4e33ef747c test: skip failing test on freebsd
The watch_file test started failing on bsd after
3ca967387c.
2023-11-10 21:10:15 +01:00
zeertzjq
d5a85d737a
fix(f_wait): flush UI before blocking (#25962) 2023-11-10 15:24:36 +08:00
zeertzjq
bf5cf8ae82
vim-patch:8.2.4078: terminal test for current directory not used on FreeBSD (#25961)
Problem:    Terminal test for current directory not used on FreeBSD.
Solution:   Make it work on FreeBSD. (Ozaki Kiichi, closes vim/vim#9516) Add
            TermWait() inside Run_shell_in_terminal() as a generic solution.

ced2b38a56

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-10 14:20:32 +08:00
Omar El Halabi
9af03bcd47
fix(options): do not change inccommand during preview (#25462) 2023-11-09 22:20:26 -06:00
zeertzjq
04d299c170 vim-patch:8.2.4932: not easy to filter the output of maplist()
Problem:    Not easy to filter the output of maplist().
Solution:   Add mode_bits to the dictionary. (Ernie Rael, closes vim/vim#10356)

d8f5f76621

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjq
f748a73a35 vim-patch:8.2.4861: it is not easy to restore saved mappings
Problem:    It is not easy to restore saved mappings.
Solution:   Make mapset() accept a dict argument. (Ernie Rael, closes vim/vim#10295)

51d04d16f2

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjq
d4dbfb092b vim-patch:8.2.4825: can only get a list of mappings
Problem:    Can only get a list of mappings.
Solution:   Add the optional {abbr} argument. (Ernie Rael, closes vim/vim#10277)
            Rename to maplist().  Rename test file.

09661203ec

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjq
2dfcd5a22b vim-patch:8.2.4820: not simple programmatic way to find a specific mapping
Problem:    Not simple programmatic way to find a specific mapping.
Solution:   Add getmappings(). (Ernie Rael, closes vim/vim#10273)

659c240cf7

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
zeertzjq
a4b80c71ea vim-patch:8.2.4140: maparg() does not indicate the type of script
Problem:    maparg() does not indicate the type of script where it was defined.
Solution:   Add "scriptversion".

a9528b39a6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-09 21:34:02 +08:00
zeertzjq
43b0e2752c
refactor(api): simplify nvim_set_keymap shortname check (#25945) 2023-11-09 12:28:43 +08:00
zeertzjq
77bb69d7b0
vim-patch:7fbbd7fdc6df (#25944)
runtime(termdebug):  handle buffer-local mappings properly

closes: vim/vim#13475

7fbbd7fdc6

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2023-11-09 08:38:25 +08:00
zeertzjq
89d785e530 vim-patch:ca48202b6f46
runtime(termdebug): improve window handling, shorten var types

closes vim/vim#13474

ca48202b6f

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2023-11-09 07:24:31 +08:00
zeertzjq
7b921c5501 vim-patch:9.0.1811: still some issues with term_debug test
Problem:  still some issues with term_debug test
Solution: Use WaitForAssert()

closes: vim/vim#12936

85c3a5bc26

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-11-09 07:05:21 +08:00
zeertzjq
4d36892191 vim-patch:9.0.1809: termdebug test flayk
Problem:  termdebug test flayk
Solution: wait slightly longer

6c93c94929

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-09 07:05:21 +08:00
zeertzjq
c9e7e94fcc vim-patch:9.0.1808: termdebug: Typo in termdebug test
Problem:  termdebug: Typo in termdebug test
Solution: fix the typos

f2534434c9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-09 07:05:21 +08:00
zeertzjq
8d3dbf2746 vim-patch:9.0.1791: No tests for the termdebug plugin
Problem:  No tests for the termdebug plugin
Solution: Add some simple tests for the termdebug plugin

closes: vim/vim#12927

58f39d89a8

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-11-09 07:05:21 +08:00
zeertzjq
f7b2ea59a6
vim-patch:9.0.2095: statusline may look different than expected (#25941)
Problem:  statusline may look different than expected
Solution: do not check for highlighting of stl and stlnc characters

statusline fillchar may be different than expected

If the highlighting group for the statusline for the current window
|hl-StatusLine| or the non-current window |hl-StatusLineNC| are cleared
(or do not differ from each other), than Vim will use the hard-coded
fallback values '^' (for the non-current windows) or '=' (for the
current window).  I believe this was done, to make sure the statusline
will always be visible and be distinguishable from the rest of the
window.

However, this may be unexpected, if a user explicitly defined those
fillchar characters just to notice that those values are then not used
by Vim.

So, let's assume users know what they are doing and just always return
the configured stl and stlnc values.  And if they want the statusline to
be non-distinguishable from the rest of the window space, so be it.  It
is their responsibility and Vim shall not know better what to use.

fixes: vim/vim#13366
closes: vim/vim#13488

6a650bf696

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-09 06:34:34 +08:00
bfredl
1b0fd377ab
Merge pull request #25767 from luukvbaal/signdel
feat(extmarks): add 'invalidate' property
2023-11-08 12:17:25 +01:00
Luuk van Baal
4e6f559b8c feat(extmarks): add 'invalidate' property to extmarks
Problem:  No way to have extmarks automatically removed when the range it
          is attached to is deleted.
Solution: Add new 'invalidate' property that will hide a mark when the
          entirety of its range is deleted. When "undo_restore" is set
          to false, delete the mark from the buffer instead.
2023-11-08 02:53:49 +01:00
zeertzjq
1c71c32b29
fix(job-control): make jobwait() flush UI after hiding cursor (#25927) 2023-11-08 06:29:58 +08:00
zeertzjq
a935c7531a
test(ui/decorations_spec): avoid flakiness caused by undo msg (#25924) 2023-11-07 11:09:50 +08:00
altermo
3198038224
fix(lua): correct return value for on_key with no arguments (#25911) 2023-11-07 08:33:38 +08:00
Christian Clason
324fad1e88 vim-patch:9.0.2092: tests: failure in test_arabic
Problem:  tests: failure in test_arabic
Solution: adjust the test for the changed arabic keymap

2a94e98792

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-05 21:56:56 +01:00
bfredl
68cb4a7405 feat(extmarks): add "undo_restore" flag to opt out of undo-restoring
It is a design goal of extmarks that they allow precise tracking
of changes across undo/redo, including restore the exact positions
after a do/undo or undo/redo cycle. However this behavior is not useful
for all usecases. Many plugins won't keep marks around for long after
text changes, but uses them more like a cache until some external source
(like LSP semantic highlights) has fully updated to changed text and
then will explicitly readjust/replace extmarks as needed.

Add a "undo_restore" flag which is true by default (matches existing
behavior) but can be set to false to opt-out of this behavior.

Delete dead u_extmark_set() code.
2023-11-05 12:18:29 +01:00
zeertzjq
ec66a95fbc
vim-patch:9.0.2090: complete_info() skips entries with 'noselect' (#25890)
Problem:  complete_info() skips entries with 'noselect'
Solution: Check, if first entry is at original text state

Unfortunately, Commit daef8c74375141974d61b85199b383017644978c
introduced a regression, that when ':set completeopt+=noselect' is set
and no completion item has been selected yet, it did not fill the
complete_info['items'] list.

This happened, because the current match item did not have the
CP_ORIGINAL_TEXT flag set and then the cp->prev pointer did point to the
original flag item, which caused the following while loop to not being
run but being skipped instead.

So when the 'noselect' is set, only start with to the previous selection
item, if the initial completion item has the CP_ORIGINAL_TEXT flag set,
else use the 2nd previous item instead.

fixes: vim/vim#13451
closes: vim/vim#13452

57f9ce1a09

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-04 21:59:03 +08:00
LW
468292dcb7
fix(rpc): "grid_line" event parsing crashes (#25581)
refactor: use a more idiomatic loop to iterate over the cells

There are two cases in which the following assertion would fail:
```c
assert(g->icell < g->ncells);
```

1. If `g->ncells = 0`. Update this to be legal.
2. If an EOF is reached while parsing `wrap`. In this case, the unpacker
   attempts to resume from `cells`, which is a bug. Create a new state
   for parsing `wrap`.

Reference: https://neovim.io/doc/user/ui.html#ui-event-grid_line
2023-11-04 06:56:45 +08:00
bfredl
44f0480a22 refactor(grid): implement rightleftcmd as a post-processing step
Previously, 'rightleftcmd' was implemented by having all code which
would affect msg_col or output screen cells be conditional on `cmdmsg_rl`.
This change removes all that and instead implements rightleft as a
mirroring post-processing step.
2023-11-03 11:35:42 +01:00
zeertzjq
4c32927084
test(ui/embed_spec): make sure server is started (#25880) 2023-11-03 08:19:04 +08:00
zeertzjq
d7359a8742
fix(startup): trigger UIEnter for the correct channel (#25860) 2023-11-01 12:16:37 +08:00
George Harker
4e6096a67f
feat(server): allow embed with listen (#25709)
connection from any channel or stdio will unblock
remote_ui_wait_for_attach.  Wait on stdio only if
only —embed specified, if both —embed and
—listen then wait on any channel.
2023-11-01 11:04:53 +08:00
Gregory Anders
224f303ee5
feat(stdlib): add vim.base64 module (#25843)
Add base64 encode() and decode() functions to a vim.base64 module.
2023-10-31 09:15:32 -05:00
zeertzjq
d4c2fc6ff6
fix(terminal): keep focus when scrolling number column of another window (#25848) 2023-10-31 15:23:20 +08:00
zeertzjq
c881092ffe
fix(terminal): don't lose focus on <MouseMove> (#25845) 2023-10-31 12:05:37 +08:00
bfredl
6d1a2f2c3c
Merge pull request #25674 from famiu/refactor/options/unify_string_options
refactor(options): unify `set_option` and `set_string_option`
2023-10-30 20:06:57 +01:00
Famiu Haque
e19cc9c9b7 refactor(options)!: unify set_option and set_string_option
While the interfaces for setting number and boolean options are now unified by #25394, there is still a separate `set_string_option` function that is used for setting a string option. This PR removes that function and merges it with set_option.

BREAKING CHANGE: `v:option_old` is now the old global value for all global-local options, instead of just string global-local options. Local value for a global-local number/boolean option is now unset when the option is set (e.g. using `:set` or `nvim_set_option_value`) without a scope, which means they now behave the same way as string options.

Ref: #25672
2023-10-30 21:38:02 +06:00
Maria José Solano
0fe0cf5ada
fix(lsp): do not cancel snippet when selecting placeholder (#25835) 2023-10-30 12:58:28 +01:00
dundargoc
2dc9ceb99c
docs: small fixes (#25585)
Co-authored-by: tmummert <doczook@gmx.de>
Co-authored-by: parikshit adhikari <parikshitadhikari@gmail.com>
2023-10-29 16:02:32 +08:00
Raphael
0da27e9bde
fix(api): load buffer first on nvim_buf_set_lines (#25823)
Fix #22670
Fix #8659
2023-10-29 15:44:52 +08:00
zeertzjq
82b1a389ba
fix(terminal): avoid Insert mode in Terminal buffer (#25820) 2023-10-29 09:32:03 +08:00
Christian Clason
c34e816608 vim-patch:9.0.2079: Not all Dart files detected
Problem:  Not all Dart files detected
Solution: Add shebang filetype detection for Dart

closes: vim/vim#13449

c1c177a47b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-10-29 01:36:51 +02:00
luukvbaal
f2fb05238a
vim-patch:9.0.2081: smoothscroll may result in wrong cursor position (#25815)
Problem:  With 'smoothscroll' set, "w_skipcol" is not reset when unsetting 'wrap'.
          Resulting in incorrect calculation of the cursor position.
Solution: Reset "w_skipcol" when unsetting 'wrap'.

fixes:  vim/vim#12970
closes: vim/vim#13439

1bf1bf569b
2023-10-29 06:05:29 +08:00
Famiu Haque
43a7945f1b test: add test coverage for #25741 2023-10-28 22:51:07 +06:00
zeertzjq
ac353e87ae
vim-patch:9.0.2075: TextChangedI may not always trigger (#25808)
Problem:  TextChangedI may not always trigger
Solution: trigger it in more cases: for insert/
          append/change operations, and when
          opening a new line,

fixes: vim/vim#13367
closes: vim/vim#13375

4bca4897a1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 10:42:18 +08:00
zeertzjq
063a78fda2 vim-patch:9.0.2077: CI fails because of trailing whitespace in test
Problem:  CI fails because of trailing whitespace in test
Solution: Remove it

87ca5e86fa

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 06:17:08 +08:00