Commit Graph

29989 Commits

Author SHA1 Message Date
e537379641 fix(channel): handle writing to file instead of pipe (#30520) 2024-09-26 08:43:51 +00:00
3a23149cfc fix(filetype): handle .in files with no filename (#30487)
Problem:
fnamemodify with the :r flag will not strip extensions if the filename
starts with a ".". This means that files named ".in" could cause an
infinite loop.

Solution:
Add early return if the filename was not changed

(cherry picked from commit 032e024f8a)
2024-09-23 23:04:34 +00:00
b380a8fe21 docs: remove mention of removed parsers
Partial backport of https://github.com/neovim/neovim/pull/29719.
2024-09-23 15:46:22 +02:00
6a44055a71 backport: fix(vim.fs): dirname() returns "." on mingw/msys2 (#30484)
fix(vim.fs): dirname() returns "." on mingw/msys2 #30480

Problem:
`vim.fs.dirname([[C:\User\XXX\AppData\Local]])` returns "." on
mingw/msys2.

Solution:
- Check for "mingw" when deciding `iswin`.
- Use `has("win32")` where possible, it works in "fast" contexts since
  b02eeb6a72.
2024-09-23 13:41:47 +00:00
2a8d80a442 test(tui_spec): prevent another case of race between paste and input (#30481)
Problem:  When input immediately follows end of bracketed paste, the
          nvim_input may be processed before the nvim_paste.
Solution: Ensure some waiting after the end of a bracketed paste.
(cherry picked from commit 5acdc4499e)
2024-09-23 12:14:20 +00:00
53e37391e8 build: silence "po" noise #30469
Problem:
Noise in stderr from src/nvim/po/CMakeLists.txt during build:

    48 substitutions on 48 lines
    "optwin.js" "optwin.js" 1299L, 57582B written
    385 substitutions on 385 lines
    "nvim.pot" "nvim.pot" 9318L, 180177B written

Solution:
Run with `-c silent source` instead of `-S`.

(cherry picked from commit cac86e9b4c)
2024-09-23 09:43:37 +00:00
b65e978a23 ci: update labeler configuration and add reviewers
(cherry picked from commit 783f6079b8)
2024-09-21 11:39:42 +00:00
1db8824fbc build: remove nix flakes (#28863)
It does not work and we don't plan on maintaining these anymore.

The flake files are being moved to
https://github.com/nix-community/neovim-nightly-overlay/pull/516
instead.

(cherry picked from commit 0e9c92a900)
2024-09-20 21:51:13 +00:00
d5a0e4ec5b fix(build): issues with s390x CI
Does not fix everything, but at least let's test run to finish before
timeout

(cherry picked from commit 176bfea135)
2024-09-20 21:44:30 +00:00
983482626d build: work around bug in make when PATH includes cmake as dir
There appears to be a bug in `make` where if a rule asks `make` to
invoke a command called `foo`, and `foo` exists somewhere in `$PATH` as
a directory (not an executable file), `make` will attempt to `execve`
that directory instead of continuing to search in later parts of the
`$PATH` for `foo` as a true executable.

The cause can be traced back to a bug in Make 4.3 which stems from their
use of the findprog function in Gnulib. This was reported to the Make
maintainers here:

https://savannah.gnu.org/bugs/index.php?57962

and then forwarded to the Gnulib maintainers here:

https://github.com/coreutils/gnulib/commit/7b1de4a

Make 4.4 does not have this bug, and I can confirm that I'm able to run
make in the Neovim repo with no further modifications to my system than
upgrading the version of make I'm using to 4.4 or 4.4.1.

As the change is small enough, and it's unlikely that make version
around the world is going to be updated in a timely manner, it makes
sense to just add a workaround for this. Using `command -v` to resolve
the `cmake` command, similar to what is already being done with
`cmake3`, makes it work correctly in all cases. Continuing to include
`... || echo cmake` at the end means that if neither `cmake3` nor
`cmake` are installed, the user will still see a message about CMake
being missing.

Co-authored-by: Jake Zimmerman <zimmerman.jake@gmail.com>
(cherry picked from commit e268fcbdaa)
2024-09-20 20:53:02 +00:00
8d842a301c build: add quotes around CMAKE_GENERATOR variable
This will fix the following error when using generators that have a
space in them, e.g. "Unix Makefiles":

"CMake Error: Could not create named generator Unix".

Closes https://github.com/neovim/neovim/issues/30218.

(cherry picked from commit ef8067a19d)
2024-09-20 20:31:39 +00:00
e63e0a2e06 build: make makefile work on windows
Using powershell as the default windows shell as using cmd alters $PATH
in a way that makes building neovim fail (powershell prioritizes visual
studio tools which is arguably more correct).

This was tested with gnu make for windows, which can be installed with
e.g. scoop. It does not work with nmake and it is extremely unlikely we
want to add nmake support as the makefile is merely supposed to be
syntactic sugar for the most common case. For similar reasons, the only
supported generator is ninja.

(cherry picked from commit 4ee65484b1)
2024-09-20 20:09:17 +00:00
50a021e653 revert: "Makefile: use pattern rules for build/.deps (#10366)"
This reverts commit 7f6ff829aa.

The given reasoning and usecase is unsatisfactory. While it is true that
it allows to run `make build/bin/nvim`, it can easily be recreated with
`ninja -C build bin/nvim` which does the exact same thing. This minor
convenience is not worth adding the extra code given how rare this
usecase should be.

(cherry picked from commit 3085c9d9da)
2024-09-20 19:26:25 +00:00
2c95d48083 ci: remove "skip ci" tag
We can't skip CI runs as there are required checks that needs to always
be run.

(cherry picked from commit dafd944a46)
2024-09-20 15:28:41 +00:00
ba47b440fd fix(treesitter): lint top-level anonymous nodes
**Problem:** Top-level anonymous nodes are not being checked by the
query linter

**Solution:** Check them by adding them to the top-level query

This commit also moves a table construction out of the match iterator so
it is run less frequently.
2024-09-20 17:15:43 +02:00
9d7711a732 ci: don't add reviewers for PRs created by a bot
This will ensure automatic backports created by the backport action does
not request reviewers (since the commit in question has already been
vetted and merged), but manual backports created by users does request
reviewers as these commits has not been vetted previously.

(cherry picked from commit 755512ed60)
2024-09-20 14:51:55 +00:00
a3f9bd7f79 feat(jumplist): allow opting out of removing unloaded buffers (#30419)
Problem:  Cannot opt out of removing unloaded buffers from the jumplist.
Solution: Only enable that with "clean" flag in 'jumpoptions'.
2024-09-19 10:32:50 +00:00
017a054e82 Merge pull request #30393 from justinmk/release
backport: vim.ui.open fixes
2024-09-16 03:27:47 -07:00
d63d379eec fix(vim.ui.open): prefer xdg-open on WSL #30302
xdg-open is usually not installed in WSL. But if the user deliberately
installs it, presumably they want to prioritize it.
2024-09-16 12:04:01 +02:00
fa4bd6994d fix(lua): ignore stdout and stderr for xdg-open
Ref #19724
Fix #29932
2024-09-16 12:03:49 +02:00
4abd480e8f vim-patch:9.1.0730: Crash with cursor-screenline and narrow window
Problem:  Crash with cursor-screenline and narrow window
          (elig0n)
Solution: Don't set right_col when width2 is 0 (zeertzjq).

fixes: vim/vim#15677
closes: vim/vim#15678

59149f0269
(cherry picked from commit 5191a11d66)
2024-09-14 12:17:48 +00:00
b4824edac1 vim-patch:9.1.0729: Wrong cursor-screenline when resizing window
Problem:  Wrong cursor-screenline when resizing window
Solution: Invalidate saved left_col and right_col when width1 or width2
          change.

closes: vim/vim#15679

86dc4f8b43
(cherry picked from commit 90585e47fe)
2024-09-14 12:17:48 +00:00
e464b8c90d Merge pull request #30380 from zeertzjq/backport
Manual backport of #30377 to release-0.10
2024-09-14 20:04:10 +08:00
260ac4b3a2 vim-patch:9.1.0728: [security]: heap-use-after-free in garbage collection with location list user data
Problem:  heap-use-after-free in garbage collection with location list
          user data.
Solution: Mark user data as in use when no other window is referencing
          the location list (zeertzjq)

fixes: neovim/neovim#30371
closes: vim/vim#15683

be4bd189d2
2024-09-14 19:35:17 +08:00
d585f3103d ci: skip automerge step if backport failed
(cherry picked from commit 67d6b6f27e)
2024-09-14 00:18:58 +00:00
f3675337f0 fix(lsp): handle nil bytes in strings
Problem:

The LSP omnifunc can insert nil bytes, which when read in other places
(like semantic token) could cause an error:

    semantic_tokens.lua:304: Vim:E976: Using a Blob as a String

Solution:

Use `#line` instead of `vim.fn.strlen(line)`. Both return UTF-8 bytes
but the latter can't handle nil bytes.

Completion candidates can currently insert nil bytes, if other parts of
Alternative fix to https://github.com/neovim/neovim/pull/30359

Note that https://github.com/neovim/neovim/pull/30315 will avoid the
insertion of nil bytes from the LSP omnifunc, but the change of this PR
can more easily be backported.

(cherry picked from commit 8512f669f0)
2024-09-13 20:59:13 +00:00
b020b66005 ci: add needs:backport label on backport PRs with conflict
This makes it easy to keep track of which backport PRs have failed and
need manual intervention to fix.

(cherry picked from commit 4c23b83456)
2024-09-13 15:16:35 +00:00
6f34f07a31 ci: enable automerge by default when backporting
This will automatically merge backported PRs without human intervention
if the tests pass.

(cherry picked from commit 057314345a)
2024-09-13 10:57:22 +00:00
23a9c67f1b Merge pull request #30344 from tris203/backport-30342-to-release-0.10
fix(health): "test_plug/health/init.lua" completes "test_plug"
2024-09-12 10:31:43 +08:00
61b0816790 test(health): "test_plug/health/init.lua" completes as "test_plug"
(cherry picked from commit 7b680e0ca9)
2024-09-11 16:07:29 +01:00
1e1e4066b1 fix(health): return correct name from 'path2name()'
`path2name()` function doesn't process `'pluginname/health/init.lua'` correctly. Instead of retruning `'pluginname'` it returns `'pluginname.health'`

(cherry picked from commit 237d2aef4d)
2024-09-11 14:36:22 +01:00
ef05c514aa fix(runtime): add remaining missing commentstrings (#30252)
(cherry picked from commit 9ddfcb64bf)
2024-09-10 09:51:05 +02:00
e13564b9f4 fix(lsp): handle encoding bounds in str_utfindex_enc
Problem:
str_utfindex_enc could return an error if the index was longer than the
line length. This was handled in each of the calls to it individually

Solution:
* Fix the call at the source level so that if the index is higher than
  the line length, utf length is returned

(cherry picked from commit f279d1ae33)
2024-09-10 09:49:25 +02:00
b55435f438 fix(lsp): handle out-of-bounds character positions #30288
Problem:
str_byteindex_enc could return an error if the index was longer than the
lline length. This was handled in each of the calls to it individually

Solution:
* Fix the call at the source level so that if the index is higher than
  the line length, line length is returned as per LSP specification
* Remove pcalls on str_byteindex_enc calls. No longer needed now that
  str_byteindex_enc has a bounds check.
2024-09-08 21:01:58 +02:00
461ed5e6bd Merge pull request #30303 from neovim/backport-30300-to-release-0.10
vim-patch:b584117: runtime(doc): buffers can be re-used
2024-09-08 06:03:38 +08:00
8611f4dcf0 vim-patch:b584117: runtime(doc): buffers can be re-used (#30300)
while at it, also move the note about :wincmd
directly to :h :wincmd, it doesn't seem to belong to the buffer section.

closes: vim/vim#15636

b584117b05

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit b40ec083ae)
2024-09-07 21:42:02 +00:00
95c3fd4dc0 fix(decor): exclude invalid marks from meta total
Problem:  Marktree meta count still includes invalidated marks, making
          guards that check the meta total ineffective.
Solution: Revise marktree metadata when in/revalidating a mark.
2024-09-06 14:20:46 +02:00
59d3d76b79 Merge pull request #30276 from neovim/backport-30274-to-release-0.10
vim-patch:9.1.0716: resetting setcellwidth() doesn't update the screen
2024-09-06 07:32:52 +08:00
886a8b62c5 vim-patch:9.1.0716: resetting setcellwidth() doesn't update the screen (#30274)
Problem:  resetting setcellwidth() doesn't update the screen
Solution: Redraw after clearing the cellwidth table (Ken Takata)

closes: vim/vim#15628

539e9b571a

Co-authored-by: Ken Takata <kentkt@csc.jp>
(cherry picked from commit d60c753cff)
2024-09-05 22:52:31 +00:00
26b72b0f91 fix(api): nvim_buf_get_text() crashes with large negative column #28740
Problem:
crash when calling nvim_buf_get_text() with a large negative start_col:

    call nvim_buf_get_text(0, 0, -123456789, 0, 0, {})

Solution:
clamp start_col after subtracting it from the line length.

(cherry picked from commit d1d7d54680)
2024-09-03 15:30:37 +02:00
1fe8dc4d2c Merge pull request #30211 from neovim/backport-30209-to-release-0.10
fix(completion): don't include <Lua function> in -complete=
2024-09-01 08:26:33 +08:00
5cb3505ab8 fix(completion): don't include <Lua function> in -complete= (#30209)
(cherry picked from commit bfa365a872)
2024-08-31 23:58:51 +00:00
0f6f5c4682 Merge pull request #30210 from neovim/backport-30207-to-release-0.10
vim-patch: doc updates
2024-09-01 07:56:44 +08:00
b5a2d52a36 vim-patch:e2c4e07: runtime(doc): Update :help :command-complete list
closes: vim/vim#15602

e2c4e07795

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
(cherry picked from commit 751ab0e4ca)
2024-08-31 22:56:45 +00:00
797f524337 vim-patch:7c8bbc6: runtime(doc): use mkdir -p to save a command
closes: vim/vim#15599

7c8bbc6d28

Co-authored-by: Ughur Alakbarov <58857108+ugur-a@users.noreply.github.com>
(cherry picked from commit 5f81c36934)
2024-08-31 22:56:45 +00:00
8aea03f7b2 Merge pull request #30205 from neovim/backport-30204-to-release-0.10
vim-patch:9.1.0707: [security]: invalid cursor position may cause a crash
2024-09-01 05:29:20 +08:00
974447bfc3 vim-patch:9.1.0707: [security]: invalid cursor position may cause a crash (#30204)
Problem:  [security]: invalid cursor position may cause a crash
          (after v9.1.0038)
Solution: Set cursor to the last character in a line, if it would
          otherwise point to beyond the line; no tests added, as it
          is unclear how to reproduce this.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4ghr-c62x-cqfh

396fd1ec29

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 6f167fcae9)
2024-08-31 21:08:30 +00:00
6ed530baa5 Merge pull request #30182 from neovim/backport-30180-to-release-0.10
fix(man): check if buffer is valid before restoring 'tagfunc'
2024-08-29 20:21:47 +08:00
d000c56373 fix(man): check if buffer is valid before restoring 'tagfunc' (#30180)
(cherry picked from commit 7588ff2d89)
2024-08-29 11:54:09 +00:00
2a32ec784c Merge pull request #30178 from neovim/backport-30176-to-release-0.10
docs(eval): wrong return type of getcharsearch
2024-08-29 18:30:46 +08:00