Commit Graph

25152 Commits

Author SHA1 Message Date
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
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
zeertzjq
402c31a82d
refactor: move ga_loaded to runtime.c (#22626) 2023-03-11 17:58:05 +08:00
Jaehwang Jung
2748202e0e fix(diff): trigger on_bytes only once after diffget/diffput
Problem: The fix from b50ee4a8dc may
adjust extmark twice, triggering on_bytes callback twice.

Solution: Don't let mark_adjust adjust extmark.
2023-03-11 18:22:00 +09:00
dundargoc
a1edbd3564
ci: skip ruby provider tests on Windows
Installing the ruby provider takes anything between 1 and 1.5 minutes on
Windows, which is a big drain on our CI. Remove it until we find a more
sustainable solution.
2023-03-11 09:41:58 +01:00
dundargoc
d8ef6770bd
Merge pull request #22577 from dundargoc/ci/external-deps
ci: test build with external dependencies on every pull request
2023-03-11 09:39:20 +01:00
dundargoc
1a71e5c362 ci: don't install unused packages
The lua client is no longer needed after
d6279f9392. One of its dependencies,
mpack, is still needed however. Remove lua-nvim and replace it with
lua-mpack.

The other packages are most likely not needed as we no longer run tests
for external dependencies.
2023-03-11 09:38:29 +01:00
dundargoc
5aaed9cbfc ci: test build with external dependencies on every pull request
Only testing the build with external dependencies on build system
changes is too naive, as demonstrated by
b9f19d3e28.
2023-03-11 09:38:29 +01:00
dundargoc
6cd7b5eeef ci: remove environment variable DEPS_BUILD_DIR from CI
If one uses .deps when DEPS_BUILD_DIR is defined in another location it
leads to very surprising behaviors, as it looks for libraries in other
places other than .deps.
2023-03-11 09:38:29 +01:00
Mathias Fußenegger
236c20795e
revert: "fix(lsp): use buffer scheme for files not stored on disk" (#22604)
Although using `buffer://` for unsaved file buffers fixes issues with
language servers like eclipse.jdt.ls or ansible-language-server, it
breaks completion and signature help for clangd.

A regression is worse than a fix for something else, so this reverts
commit 896d672736.

The spec change is also still in dicussion, see
https://github.com/microsoft/language-server-protocol/pull/1679#discussion_r1130704886
2023-03-11 07:35:23 +01:00
zeertzjq
a7cd79349c
refactor(runtime.c): factor out find_script_by_name() (#22620)
This the refactoring done in Vim patch 8.2.4050.
2023-03-11 12:47:27 +08:00
Michal Liszcz
674e23f19c
vim-patch:9.0.0244: cannot easily get the list of sourced scripts (#22596)
Problem:    Cannot easily get the list of sourced scripts.
Solution:   Add the getscriptinfo() function. (Yegappan Lakshmanan,
            closes vim/vim#10957)

f768c3d19c

Cherry-pick usr_41.txt change from a later runtime update.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-03-11 11:22:22 +08:00
zeertzjq
8cb5b995b6
vim-patch:9.0.1397: highlight for popupmenu kind and extra cannot be set (#22619)
Problem:    Highlight for popupmenu kind and extra cannot be set.
Solution:   Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel
            highlight groups and use them. (Gianmaria Bajo, closes vim/vim#12114)

6a7c774920

Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
2023-03-11 10:05:47 +08:00
dundargoc
29a43ef8af
build: explicitly add dependency include dir for header generation
Neovim and the generated headers needs to use the same include
directories to build correctly. However, we need to generate headers
before all target dependencies has been resolved, meaning that we cannot
rely on any target to determine the final list of include directories.
This may lead to a problems when bundling some, but not all or none,
dependencies as the dependency include directory won't be included.

Also remove the dependency path options as this assumes a specific
structure on the dependency build directory.
2023-03-10 22:40:41 +01:00
Lewis Russell
9d70fe062c feat(treesitter)!: consolidate query util functions
- And address more type errors.
- Removed the `concat` option from `get_node_text` since it was applied
  inconsistently and made typing awkward.
2023-03-10 16:35:06 +00:00
Mathias Fußenegger
d3c8d104bc
fix(lsp): prevent lsp tests from picking up local user config (#22606)
Sets `NVIM_APPNAME` for the lsp server instances and also for the
`exec_lua` environment to ensure local user config doesn't interfere
with the test cases.

My local `ftplugin/xml.lua` broke the LSP test cases about setting
`omnifunc` defaults.
2023-03-10 17:30:40 +01:00
Lewis Russell
762a06c6bc
feat!(treesitter): do not return changes from LanguageTree:parse()
Never return the changes an only notify them using the `on_changedtree`
callback.

It is not guaranteed for a plugin that it'll be the first one to call
`tree:parse()` and thus get the changes.

Closes #19915
2023-03-10 16:16:49 +00:00
Lewis Russell
845efb8e12
Merge pull request #22594 from lewis6991/perf/treefold 2023-03-10 13:35:07 +00:00
Null Chilly
75537768ef
perf(lsp): better binary search mid calculation in semantic token (#22607)
This commit replaces the usage of math.floor((lo + hi) / 2) with the faster and equivalent bit.rshift(lo + hi, 1) for calculating the midpoint in binary search.
2023-03-10 14:10:38 +01:00
Lewis Russell
46b73bf22c perf(treesitter): more efficient foldexpr 2023-03-10 11:51:33 +00:00
Lewis Russell
c5b9643bf1 fix(treesitter): better lang handling of get_parser() 2023-03-10 10:43:35 +00:00
Lewis Russell
adfa9de8eb fix(treesitter): do not error on empty filetype
Ignore instead
2023-03-10 10:41:19 +00:00
Lewis Russell
4f75960660 fix(treesitter): correct include_bytes arg for parse() 2023-03-10 10:08:32 +00:00
Christian Clason
8a3220ba49
build(deps): set query parser to release (#22603) 2023-03-10 10:05:47 +01:00
Jaehwang Jung
0ecb4d725e
docs(lsp): type annotation for lsp.client (#22509)
* Also fix newly found type mismatch.
* Note that it generates new warnings about using @private client
  methods. A proper fix would be to revamp the lsp client documentation
  altogether.
2023-03-09 21:17:08 +00:00
Amaan Qureshi
68aa2857dd
vim-patch:9.0.1393: Cairo files are not recognized (#22578)
Problem:    Cairo files are not recognized.
Solution:   Add a pattern for Cairo files. (Amaan Qureshi, closes vim/vim#12118)

ff226d49fe
2023-03-09 18:13:44 +01:00
Lewis Russell
ae263aff95
refactor(treesitter): use byte ranges from treesitter (#22589) 2023-03-09 16:09:39 +00:00
red
64d3f68c07
build: fix build warning when using gcc 4.9.2
Problem:
When building with gcc 4.9.2, tree-sitter throws warning: "for loop initial
declarations are only allowed in C99 or C11 mode"

Solution:
set CMAKE_C_STANDARD option to 99
2023-03-09 16:46:34 +01:00
Michal Liszcz
9ef7297ef1
feat(lsp): overwrite omnifunc/tagfunc set by ftplugin #22267
Problem:
Some built-in ftplugins set omnifunc/tagfunc/formatexpr which causes
lsp.lua:set_defaults() to skip setup of defaults for those filetypes.
For example the C++ ftplugin has:
    omnifunc=ccomplete#Complete
          Last set from /usr/share/nvim/runtime/ftplugin/c.vim line 30
so the changes done in #95c65a6b221fe6e1cf91e8322e7d7571dc511a71
will always be skipped for C++ files.

Solution:
Overwrite omnifunc/tagfunc/formatexpr options that were set by stock
ftplugin.

Fixes #21001
2023-03-09 06:12:56 -08:00
Justin M. Keyes
ce0fddf5ae
feat: try to recover from missing tempdir #22573
Problem:
If vim_tempdir mysteriously goes missing (typically by "antivirus" on
Windows), any plugins using tempname() will be broken for the rest of
the session. #1432 #9833 https://groups.google.com/g/vim_use/c/ef55jNm5czI
Steps:
    mkdir foo
    TMPDIR=./foo nvim
    :echo tempname()
    !rm -r foo
    :echo tempname()
    tempname() still uses the foo path even though it was deleted.

Solution:
- Don't assume that vim_tempdir exists.
- If it goes missing once, retry vim_mktempdir and log (silently) an error.
- If it goes missing again, retry vim_mktempdir and show an error.

Rejected in Vim for performance reasons:
  https://groups.google.com/g/vim_use/c/qgRob9SWDv8/m/FAOFVVcDTv0J
  https://groups.google.com/g/vim_dev/c/cogp-Vye4oo/m/d_SVFXBbnnoJ
But, logging shows that `vim_gettempdir` is not called frequently.

Fixes #1432
Fixes #9833
Fixes #11250
Related: stdpath("run") f50135a32e
2023-03-09 05:07:36 -08:00
bfredl
46d4d420e5
Merge pull request #22547 from luukvbaal/statusline
perf(statusline): UI elements are always redrawn on K_EVENT
2023-03-09 11:06:47 +01:00
Evgeni Chasnovski
e17581fa53
docs: add missing highlight groups for floats 2023-03-09 10:54:39 +01:00
zeertzjq
3ad8458824
vim-patch:8.2.1067: expression "!expr->func()" does not work (#22585)
Problem:    Expression "!expr->func()" does not work.
Solution:   Apply plus and minus earlier. (closes vim/vim#6348)

0b1cd52ff6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-09 13:47:01 +08:00