Commit Graph

27535 Commits

Author SHA1 Message Date
dundargoc
cd097ab8cc build: allow using system rocks
This allow distributions and other interested parties to use a system
busted rather than the on neovim bundles by passing the
-D USE_BUNDLED_BUSTED=ON flag to cmake when building.

Closes https://github.com/neovim/neovim/issues/23814.
2023-11-07 08:56:08 +01:00
zeertzjq
a935c7531a
test(ui/decorations_spec): avoid flakiness caused by undo msg (#25924) 2023-11-07 11:09:50 +08:00
zeertzjq
6f936c9d85
fix(man): make :Man with a range work (#25922) 2023-11-07 10:39:27 +08:00
altermo
3198038224
fix(lua): correct return value for on_key with no arguments (#25911) 2023-11-07 08:33:38 +08:00
dundargoc
88ed9ffcd1 ci: work around flaky python3 tests
Python3 provider tests suddenly became extremely flaky on macos for
unknown reasons. For some reason, installing python with the
setup-python action over using the default python fixes the flakiness.
Use this workaround for the time being to unblock CI while we figure out
the root cause.
2023-11-06 23:06:35 +01:00
Gregory Anders
56627ca242
feat(tui): use TermResponse event for OSC responses (#25868)
When the terminal emulator sends an OSC sequence to Nvim (as a response
to another OSC sequence that was first sent by Nvim), populate the OSC
sequence in the v:termresponse variable and fire the TermResponse event.
The escape sequence is also included in the "data" field of the
autocommand callback when the autocommand is defined in Lua.

This makes use of the already documented but unimplemented TermResponse
event. This event exists in Vim but is only fired when Vim receives a
primary device attributes response.

Fixes: https://github.com/neovim/neovim/issues/25856
2023-11-06 12:42:40 -06:00
ObserverOfTime
f9416470b1 fix(build): include FindPackageHandleStandardArgs 2023-11-06 17:46:02 +01:00
zeertzjq
0774d0cfe1
vim-patch:da4e433dc3be (#25912)
runtime(doc): document vim-script library function

da4e433dc3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-06 19:03:08 +08:00
bfredl
cfe23a80f0
Merge pull request #25905 from bfredl/nested_rabbit_holes
refactor(grid): reimplement 'rightleft' as a post-processing step
2023-11-06 11:45:34 +01:00
Christian Clason
f1e9aa8f7e build(deps): bump luajit to HEAD - 07b3cd3cf 2023-11-06 08:12:00 +01: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
Christian Clason
bbd7ec9e64 vim-patch:caee7956a21a
runtime(keymap): Switch Hindu-Arabic to Arabic numerals in arabic keymap (vim/vim#13430)

caee7956a2

Co-authored-by: avidseeker <avidseeker7@protonmail.com>
2023-11-05 21:56:56 +01:00
Christian Clason
b329a21bd3 vim-patch:3d37231437fc
runtime(tar): improve the error detection

Do not rely on the fact, that the last line matches warning, error,
inappropriate or unrecognized to determine if an error occurred. It
could also be a file, contains such a keyword.

So make the error detection slightly more strict and only assume an
error occured, if in addition to those 4 keywords, also a space matches
(this assumes the error message contains a space), which luckily on Unix
not many files match by default.

The whole if condition seems however slightly dubious.  In case an error
happened, this would probably already be caught in the previous if
statement, since this checks for the return code of the tar program.

There may however be tar implementations, that do not set the exit code
for some kind of error (but print an error message)? But let's keep this
check for now, not many people have noticed this behaviour until now, so
it seems to work reasonably well anyhow.

related: vim/vim#6425
fixes: vim/vim#13489

3d37231437

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-05 21:56:56 +01:00
Christian Clason
dcf5999fcd vim-patch:b2a4c110a5d1
runtime(dist): Make dist/vim.vim work properly when lacking vim9script support (vim/vim#13487)

`:return` cannot be used outside of `:function` (or `:def`) in older Vims
lacking Vim9script support or in Neovim, even when evaluation is being skipped
in the dead `:else` branch.

Instead, use the pattern described in `:h vim9-mix`, which uses `:finish` to end
script processing before it reaches the vim9script stuff.

b2a4c110a5

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-11-05 21:52:02 +01:00
Christian Clason
2a47dbe228 vim-patch:4f174f0de90b
runtime(dist): add legacy version for central vim library

Also, enable the zip and gzip plugins by default, unless those variables
were not explicitly set by the user.

related: vim/vim#13413

4f174f0de9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-05 21:52:02 +01:00
Christian Clason
26cdff0e92 vim-patch:cd8a3eaf5348
runtime(dist): centralize safe executable check and add vim library (vim/vim#13413)

Follow up to 816fbcc26 (patch 9.0.1833: [security] runtime file fixes,
2023-08-31) and f7ac0ef50 (runtime: don't execute external commands when
loading ftplugins, 2023-09-06).

This puts the logic for safe executable checks in a single place, by introducing
a central vim library, so all filetypes benefit from consistency.

Notable changes:
- dist#vim because the (autoload) namespace for a new runtime support
  library. Supporting functions should get documentation. It might make
  life easier for NeoVim devs to make the documentation a new file
  rather than cram it into existing files, though we may want
  cross-references to it somewhere…
- The gzip and zip plugins need to be opted into by enabling execution
  of those programs (or the global plugin_exec). This needs
  documentation or discussion.
- This fixes a bug in the zig plugin: code setting s:tmp_cwd was removed
  in f7ac0ef50 (runtime: don't execute external commands when loading
  ftplugins, 2023-09-06), but the variable was still referenced. Since
  the new function takes care of that automatically, the variable is no
  longer needed.

cd8a3eaf53

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2023-11-05 21:52:02 +01:00
dundargoc
8ae39eb584 build: remove git requirement
We do not have any patches that we use at the moment, so git is not
needed right now. Futhermore, we've become more strict with not adding
patches, which makes it pretty safe to remove this for the time being.
2023-11-05 21:39:24 +01:00
dundargoc
397b92e02d build: enable ASAN for MSVC
It is enabled with ENABLE_ASAN_UBSAN like other compilers. Technically
it only enables ASAN as UBSAN is not available, meaning to make the
variable names fully correct we'd need to separate it into two checks:
ENABLE_ASAN and ENABLE_UBSAN, but the convenience of combining them into
the same flag outweighs the theoretical correctness.

Also note in CONTRIBUTING.md that debug builds in ASAN is not supported.
Technically it is the debug runtime that is not supported, which cmake
automatically enables when using the debug build type. However, neovim
can't be built with debug builds without linking to the debug runtime
since the third party libraries has likely been linked to the debug
runtime if it was built with debug build type. This technicality is
likely uninteresting to the potential developer and it's easier to just
say to use a release build type.
2023-11-05 21:39:12 +01:00
bfredl
83db9115af refactor(grid): reimplement 'rightleft' as a post-processing step
problem: checks for wp->w_p_rl are all over the place, making simple
things like "advance column one cell" incredibly complicated.

solution: always fill linebuf_char[] using an incrementing counter,
and then mirror the buffer as a post-processing step

This was "easier" that I first feared, because the stupid but simple
workaround for things like keeping linenumbers still left-right,
e.g. "mirror them and them mirror them once more" is more or less
what vim did already. So let's just keep doing that.
2023-11-05 21:19:35 +01:00
dundargoc
acc646ad8f refactor: the long goodbye
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
2023-11-05 20:19:06 +01:00
Christian Clason
c513cbf361 build(deps): bump luajit to HEAD - 0afa1676b 2023-11-05 15:25:44 +01:00
Christian Clason
a8aebcff50 build(deps): bump libiconv to 1.17
new license (LGPL 2.1), adds EBCDIC encodings
2023-11-05 13:30:47 +01:00
bfredl
22fa66bb1d
Merge pull request #25882 from bfredl/noundo
feat(extmarks): add "no_undo_restore" flag to opt out of undo-restoring
2023-11-05 13:17:23 +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
dundargoc
4d757bbfbb refactor: combine regexp files
regext_bt.c and regexp_nfa.c are inlined into regexp.c instead of
included as a header. This makes developer tools like clang-tidy and
clangd be able to understand the code better.
2023-11-05 11:48:42 +01:00
dundargoc
92e99bb105 ci: don't install unzip
It is no longer needed now that luarocks isn't used.
2023-11-05 11:40:54 +01:00
dundargoc
5cefec7349 build: various cmake fixes
- silence false warnings on MSVC
- merge `clang-tidy` cmake target into `lintc` and remove the
  corresponding make target
- use cmake's built-in endianness detection
2023-11-04 18:32:47 +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
L Lllvvuu
6c150e0b93 docs(treesitter): add disclaimer about needing to parse before get_node()
Problem:
---
Misuse of `get_node()` is common:
https://github.com/search?q=get_node_at_cursor+language%3Alua&type=code

Solution:
---
Add a note clarifying proper usage.
2023-11-04 14:55:44 +01:00
Christian Clason
d3e9cbedc7 vim-patch:ce3b0136c6d9
runtime(sh): Update sh syntax and add shDerefOffset to shDerefVarArray for bash (vim/vim#13480)

Add shDerefOffset to shDerefVarArray.

Example code:

```bash
declare -a a=({a..z})

echo "${a[@]:1:3}"
```

ce3b0136c6

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-11-04 12:55:54 +01:00
Christian Clason
e960fa2412 vim-patch:2f54c13292af
runtime(script.vim): make strace ft check less strict (vim/vim#13482)

Strace output, depending on parameters (-ttf this time), can dump both
times and pid:
  1038  07:14:20.959262 execve("./e.py", ["./e.py"], 0x7ffca1422840 /* 51 vars */) = 0 <0.000150>

So loose the regexp matching this, so that the above is matched too.

Fixes vim/vim#13481.

2f54c13292

Co-authored-by: Jiri Slaby <jirislaby@gmail.com>
Co-authored-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
2023-11-04 12:55:25 +01:00
Mathias Fussenegger
9281edb334 fix(lsp): create per client params in lsp.buf.code_action
`code_action` used the same parameters for all clients, which led to the
following warning and incorrect start/end column locations if using
clients with mixed encodings:

    warning: multiple different client offset_encodings detected for
    buffer, this is not supported yet
2023-11-04 08:17:42 +01: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
dundargoc
9ad239690f ci: various fixes
- adjust reviewers
- add workflow as cache key
- install attr only when tesitng
- fix s390x workflow by checking out the merge PR instead of master
2023-11-03 22:16:45 +01:00
bfredl
310896f6aa
Merge pull request #25874 from bfredl/lets_rock
refactor(grid): implement rightleftcmd as a post-processing step
2023-11-03 14:25:15 +01: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
Christian Clason
d4dc1355ed vim-patch:1858e2b22ad1
runtime(sh) Update sh syntax and add shDblParen to shCaseList (vim/vim#13469)

1858e2b22a

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-11-03 10:04:55 +01:00
Christian Clason
80cf1ee2c5 vim-patch:2b89afd5eb63
runtime(debversions): Add noble (24.04 LTS) as Ubuntu release name (vim/vim#13472)

2b89afd5eb

Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-11-03 10:04:55 +01:00
zeertzjq
4c32927084
test(ui/embed_spec): make sure server is started (#25880) 2023-11-03 08:19:04 +08:00
dundargoc
5a2543c159
docs: small fixes (#25831)
Co-authored-by: Peter Aronoff <peter@aronoff.org>
2023-11-03 07:22:02 +08:00
Gregory Anders
c1a05f6112
build: make the vimdoc generation depend on the nvim target (#25876)
The gen_vimdoc.py script uses the nvim executable, so the executable
must be built before running the script.
2023-11-02 12:34:16 -07:00
Gregory Anders
e0d97d264f
build: use built nvim artifact to generate eval files (#25875)
In cases where the generated files depend on changes to Nvim itself,
generating the files with an older version of Nvim will fail because
those changes are not present in the older version.

For example, if a new option is added then the generator script should
be run with the version of Nvim that contains the new option, or else
the generation will fail.

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-11-02 11:12:38 -07:00
bfredl
363e029e7a
Merge pull request #25859 from luukvbaal/extmarkdel
refactor(extmarks): extmark_del() with MarkTreeIter
2023-11-02 10:55:56 +01:00
Luuk van Baal
14c7bf3916 refactor(extmarks): extmark_del() with MarkTreeIter 2023-11-01 23:20:38 +01:00
dundargoc
20dd9f3a26 ci: add optional CI that can be triggered manually
These are meant for expensive or situational tests that may not be
suitable to run each time, but can occasionally be useful.

Currently only add testing for s390x. The job is enabled by adding the
ci-s390x label in github.
2023-11-01 11:17:35 +01:00
dundargoc
1997ef134a build: set char to always be signed
Sticking to the same convention makes it easier to reason about the code
and reduces complexity.
2023-11-01 08:20:24 +01: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
746a153bc1
fix(base64): only check padding if leftover index is set (#25854) 2023-10-31 10:13:45 -05: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