Commit Graph

25183 Commits

Author SHA1 Message Date
Christian Clason
8408405cb3 build(deps): bump luacheck to 1.1.0-1
also ignore two new warnings showing false positives
2023-03-15 19:23:27 +01:00
Christian Clason
17ff65f59a build(deps): bump coxpcall to 1.17.0-1 2023-03-15 18:37:08 +01:00
Christian Clason
46079c3396 build(deps): bump luarocks to v3.9.2
Changes from 3.8.0:
https://github.com/luarocks/luarocks/blob/master/CHANGELOG.md#whats-new-in-luarocks-392
2023-03-15 18:10:54 +01:00
Christian Clason
5a38e951ec
build(deps): bump tree-sitter to HEAD - a318b42c8 2023-03-15 14:25:04 +01:00
Justin M. Keyes
210120dde8
fix(lua): vim.deprecate() shows ":help deprecated" #22677
Problem:
vim.deprecate() shows ":help deprecated" for third-party plugins. ":help
deprecated" only describes deprecations in Nvim, and is unrelated to any
3rd party deprecations.

Solution:
If `plugin` is specified, don't show  ":help deprecated".

fix #22235
2023-03-15 05:56:13 -07:00
Justin M. Keyes
21eacbfef3
docs(html): render @see items as a list #22675
Needed for "flow" HTML layout.

Flow layout before:
    See also:
    https://github.com/kikito/inspect.lua https://github.com/mpeterv/vinspect
Flow layout after:
    See also:
    - https://github.com/kikito/inspect.lua
    - https://github.com/mpeterv/vinspect
2023-03-15 04:51:44 -07:00
Enan Ajmain
d4e2bfbe9c
test: Windows not detected in msys shells #22671
Problem:
The functional tests have `is_os(s)` to determine if the current os is.
E.g. `is_os("win")` returns true if the current os is Windows. This is
done by checking if the sysname as detected by luv contains the
substring 'windows'.  In MSYS shells, the sysname is looks like
MINGWXX_NT, where XX is either 32 or 64.  So if you're using busted or
luv that you built separately, not the nvim-bundled versions, then
`is_os(s)` won't work.

Solution:
Treat sysname containing "mingw" as Windows.
2023-03-15 04:17:30 -07:00
bfredl
d1e0f7454b
Merge pull request #22666 from bfredl/unscreen
refactor(screen): screen.c delenda est
2023-03-14 14:00:56 +01:00
bfredl
d6ecead364 refactor(screen): screen.c delenda est
drawscreen.c vs screen.c makes absolutely no sense.
The screen exists only to draw upon it, therefore helper functions
are distributed randomly between screen.c and the file that
does the redrawing. In addition screen.c does a lot of drawing on the
screen.

It made more sense for vim/vim as our grid.c is their screen.c

Not sure if we want to dump all the code for option chars into
optionstr.c, so keep these in a optionchar.c for now.
2023-03-14 13:37:43 +01:00
Ivan
4f7879dff0
fix(lsp): kill buffers after renaming a directory #22618
Problem:

When LSP client renames a directory, opened buffers in the edfitor are not
renamed or closed. Then `:wall` shows errors.

https://github.com/neovim/neovim/blob/master/runtime/lua/vim/lsp/util.lua#L776
works correctly if you try to rename a single file, but doesn't delete old
buffers with `old_fname` is a dir.

Solution:
Update the logic in runtime/lua/vim/lsp/util.lua:rename()

Fixes #22617
2023-03-14 05:08:37 -07:00
hrsh7th
8dde7c907c
fix(lsp): vim.lsp.util.apply_text_edits cursor validation #22636
Problem
Using wrong variable when checking the cursor position is valid or not in
vim.lsp.util.apply_text_edits.

Solution
Use the correct variable.
2023-03-14 04:59:43 -07:00
Zoltán Reegn
06e3ff6671
docs(lsp): opt-out of default LSP "gq" #22615
close #22611
2023-03-14 03:42:27 -07:00
Christian Clason
4395b5f93a
Merge pull request #22658 from clason/help-marks
fix(help): force tree reparse after local addition insertion
docs(help): consistent headers for local additions
2023-03-14 11:35:05 +01:00
bfredl
ef31444ccc
Merge pull request #22659 from bfredl/floatruler
fix(screen): redraw the ruler for a current floating window
2023-03-14 11:28:48 +01:00
bfredl
0f1e2b6686 fix(screen): redraw the ruler for a current floating window
Semi-regression. The "ruler" behavior for a floating window
was never really specified but in practice followed the users
cursor movements in normal mode in a focused float, which seems
like a reasonable behavior to now specify.
2023-03-14 11:01:45 +01:00
Christian Clason
27b467bad2
build(deps): bump tree-sitter to v0.20.8 (#22663) 2023-03-14 09:29:56 +01:00
dundargoc
3e8955094a
test: re-bundle cat on windows (#21255)
The builtin cat was removed in 4bc9229ecb
as it is not used during runtime but only for tests. However, it is a
very small and useful utility program that we need for a lot of our
tests, so there's no harm in bundling it, and it helps us avoid
complicating our build system by having two versions of neovim (neovim
for users and neovim for testing).

Also skip tests if "grep" or "sleep" isn't available.
2023-03-14 09:12:26 +08:00
Christian Clason
9ab814eafa docs(help): consistent headers for local additions 2023-03-13 20:17:31 +01:00
Christian Clason
95ab5a0da3 fix(help): force tree reparse after local addition insertion
Problem: *local-additions* in `help.txt` are inserted via `ml_append`,
which messes up treesitter highlighting of this file as the buffer
becomes desynced from the tree.

Solution: Add hack on top of hack by explicitly calling `mark_adjust`
and `changed_lines_buf` after each insertion.
2023-03-13 20:17:31 +01:00
Dan Strokirk
f01f18cdf4
fix(lsp): remove_workspace_folders fails if client has no workspace_folders #22633
When a client has no workspace_folders, (e.g., copilot), `pairs`
code would crash.
2023-03-13 06:01:34 -07:00
Christian Clason
4e99cc1217
Merge pull request #22627 from nullchilly/highlight-cleanup
refactor!: remove deprecated functions
2023-03-13 13:59:38 +01:00
Lewis Russell
35799a6629
fix(treesitter): foldexpr (#22652)
The ranges passed to foldinfo.remove_range were in the wrong order.
2023-03-13 10:44:43 +00:00
zeertzjq
773febc460
test(old): unskip working tests on Windows (#22650) 2023-03-13 12:44:44 +08:00
dundargoc
b466e1d289
test: unskip working Windows tests (#22537)
Some tests that were previously not working have started to work again
for unspecified reasons, so let's enable them.
2023-03-13 11:15:24 +08:00
ii14
2daf0b37db
feat(options)!: deprecate paste, remove pastetoggle (#22647)
we cannot remove 'paste'. It is very common in plugins and configs.

'pastetoggle' can and should be removed though, it's a total waste of everyone's time because it generates bug reports and doesn't work well, and is useless because bracketed-paste works better.
2023-03-13 10:29:11 +08:00
Justin M. Keyes
673d2b52fa refactor!: rename vim.pretty_print => vim.print
Problem:
The function name `vim.pretty_print`:
1. is verbose, which partially defeats its purpose as sugar
2. does not draw from existing precedent or any sort of convention
   (except external projects like penlight or python?), which reduces
   discoverability, and degrades signaling about best practices.

Solution:
- Rename to `vim.print`.
- Change the behavior so that
  1. strings are printed without quotes
  2. each arg is printed on its own line
  3. tables are indented with 2 instead of 4 spaces
- Example:
  :lua ='a', 'b', 42, {a=3}
  a
  b
  42
  {
    a = 3
  }

Comparison of alternatives:
- `vim.print`:
  - pro: consistent with Lua's `print()`
  - pro: aligns with potential `nvim_print` API function which will
    replace nvim_echo, nvim_notify, etc.
  - con: behaves differently than Lua's `print()`, slightly misleading?
- `vim.echo`:
  - pro: `:echo` has similar "pretty print" behavior.
  - con: inconsistent with Lua idioms.
- `vim.p`:
  - pro: very short, fits with `vim.o`, etc.
  - con: not as discoverable as "echo"
  - con: less opportunity for `local p = vim.p` because of potential shadowing.
2023-03-13 01:25:09 +01:00
zeertzjq
5aec611469
test(float_spec): add missing sum_scroll_delta #22648 2023-03-12 17:14:02 -07:00
Matthias Deiml
fd2ece278b
feat(ui): add scroll_delta to win_viewport event #19270
scroll_delta contains how much the top line of a window moved since the
last time win_viewport was emitted. It is expected to be used to
implement smooth scrolling. For this purpose it only counts "virtual" or
"displayed" so folds should count as one line. Because of this it
adds extra information that cannot be computed from the topline
parameter.

Fixes #19227
2023-03-12 15:58:46 -07:00
bfredl
e5f4394eb7
Merge pull request #22590 from bfredl/status2
refactor(redraw): make cursor position use the "redraw later" pattern
2023-03-12 13:47:39 +01:00
bfredl
846a056744 refactor(redraw): make cursor position redraw use the "redraw later" pattern 2023-03-12 10:18:57 +01:00
Mathias Fußenegger
d15abd1be4
fix(lsp): use line start/end for visual line selection (#22632)
Fixes https://github.com/neovim/neovim/issues/22629
2023-03-12 09:45:28 +01:00
zeertzjq
314f20a44f
test: use a wider screen in the rightleft winhl test (#22641)
With a wide screen this actually previously caused an overflow.
2023-03-12 15:41:39 +08:00
zeertzjq
172227a446
fix(screen): correctly draw background and eob with 'rightleft' (#22640) 2023-03-12 12:10:27 +08:00
nullchilly
2ae54cef6e docs: add removed features in news.txt 2023-03-12 10:30:46 +07:00
zeertzjq
1c4b3d41b5
fix(sleep): correct cursor placement (#22639)
Just setcursor_mayforce(true) is enough as Nvim uses msg_grid.
2023-03-12 10:40:27 +08:00
zeertzjq
714f6bf249
vim-patch:9.0.1401: condition is always true (#22638)
Problem:    Condition is always true.
Solution:   Remove the condition. (closes vim/vim#12139)

c481ad38f0
2023-03-12 08:02:58 +08:00
dundargoc
9d574f8dd7
ci: bump to windows 2022
Skip failing funcitonaltests. Use jobstart() instead termopen() for
oldtests to prevent CI freezing.
2023-03-11 22:56:16 +01:00
dundargoc
829d92eca3
revert: "build: enable cmake workflow presets (#21860)"
This reverts commit 00a976129b.

Visual Studio fails the build if the CMakePresets.json version is too
high and the CMakePresets.json integration is enabled.

Closes https://github.com/neovim/neovim/issues/22608.
2023-03-11 19:21:54 +01:00
Lewis Russell
b55b8ddf81
Merge pull request #22613 from lewis6991/feat/tsqueryutil 2023-03-11 17:13:20 +00:00
Lewis Russell
58bbc2ea0b refactor(treesitter): add Range type aliase for Range4|Range6 2023-03-11 16:38:18 +00:00
Jaehwang Jung
0ce626b783
docs(lsp): more precise type annotations (#22621) 2023-03-11 14:50:53 +01:00
Mathias Fußenegger
23dc2a59b6
fix(lsp): send didClose on buffer rename (#22623)
Subset of https://github.com/neovim/neovim/pull/22407 that was reverted
in https://github.com/neovim/neovim/pull/22604

If a buffer is renamed sending `didClose` for the old buffer helps
ensure the language server doesn't keep a stale document in memory.
2023-03-11 14:50:14 +01:00
Raphael
865d8d4720
refactor(lsp): remove _resolve_capabilities_compat (#22628) 2023-03-11 14:49:53 +01:00
zeertzjq
7dc9182cf0
vim-patch:8.2.1398: autoload script sourced twice if sourced directly (#22622)
Problem:    Autoload script sourced twice if sourced directly.
Solution:   Do not source an autoload script again. (issue vim/vim#6644)

daa2f36573

Cherry-pick ret_sid changes from patch 8.2.0149.
Use do_in_runtimepath() as that's what source_runtime() calls in Nvim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-11 21:29:25 +08:00
zeertzjq
6d0c61d90d
fix(api): set script context when setting usercmd or option (#22624) 2023-03-11 21:09:11 +08:00
zeertzjq
8065fc9aae
fix(edit): don't subtract msg_scrolled when removing double quote (#22630)
With msg_grid there is no need to subtract msg_scrolled.
2023-03-11 20:12:58 +08:00
bfredl
f3efcd0348
Merge pull request #22625 from tomtomjhj/diff-on_bytes-once
fix(diff): trigger on_bytes only once after diffget/diffput
2023-03-11 12:33:01 +01:00
nullchilly
36ca082a11 refactor(health)!: remove deprecated health.lua 2023-03-11 17:59:26 +07:00
nullchilly
71eebd28d1 refactor(treesitter)!: remove deprecated show_tree func 2023-03-11 17:59:26 +07:00
nullchilly
c2f7f8d61c refactor(highlight)!: remove deprecated functions
vim.highlight.create/link
2023-03-11 17:59:06 +07:00