Commit Graph

5426 Commits

Author SHA1 Message Date
Christian Clason
e3389c1533 build(deps): bump tree-sitter-lua to v0.0.18
also update highlight queries
2023-08-28 11:03:42 +09:00
Christian Clason
f5e6f592b6 build(deps): bump tree-sitter-c to v0.20.5
also update highlight queries and test

fixup: tests
2023-08-28 11:03:42 +09:00
Lewis Russell
3cca5449ac fix(editorconfig): only warn once on errors
(cherry picked from commit f3e8942ce2)
2023-08-27 21:04:32 +00:00
ObserverOfTime
2aa88ee86a feat(editorconfig): update Lua code in syntax file
(cherry picked from commit 5f29f7b59f)
2023-08-27 20:49:50 +00:00
ObserverOfTime
2ac6405e80 fix(editorconfig): add metadata comment
(cherry picked from commit aa4900dff0)
2023-08-27 20:49:50 +00:00
ObserverOfTime
96dc2d559b fix(editorconfig): highlight properties with dashes
(cherry picked from commit bcf91761bf)
2023-08-27 20:49:50 +00:00
Bogdan Grigoruță
11cb728c35 fix(editorconfig): add missing root validation
(cherry picked from commit a94d35fcde)
2023-08-27 20:35:49 +00:00
Lewis Russell
9f928902c7 fix(editorconfig): do not set 'endofline'
Problem:
  'endofline' can be used to detect if a file ends of <EOL>, however
  editorconfig can break this.

Solution:
  Set 'endofline' during BufWritePre

Fixes: #24869
(cherry picked from commit 84376afc72)
2023-08-27 20:13:39 +00:00
zeertzjq
392e0b56f0
docs: backport intro.txt changes to release-0.9 (#24698) 2023-08-13 21:18:01 +08:00
Lewis Russell
ac2dff64a5 fix(treesitter): make sure injections don't return empty ranges (#24595)
When an injection has not set include children, make sure not to add
the injection if no ranges are determined.

This could happen when there is an injection with a child that has the
same range as itself. e.g. consider this Makefile snippet

```make
foo:
  $(VAR)
```

Line 2 has an injection for bash and a make variable reference. If
include-children isn't set (default), then there is no range on line 2
to inject since the variable reference needs to be excluded.

This caused the language tree to return an empty range, which the parser
now interprets to mean the full buffer. This caused makefiles to have
completely broken highlighting.
2023-08-10 18:08:54 +02:00
Sean Dewar
df63474930
fix(lsp): do not assume client capability exists in watchfiles check (#24558)
Backports #24550.

Adjusts test to expect that didChangeWatchedFiles is *not* registered if
client `capabilities` is nil (as it's not enabled by default for v0.9).
2023-08-04 10:16:54 +01:00
zeertzjq
d6733abc69 fix(ui-ext): backport win_viewport fixes to release-0.9 2023-07-25 22:56:02 +08:00
fredizzimo
dfed74188d
[Backport release-0.9] fix(ui): delay win_viewport until screen update #24182 (#24480)
fix(ui): delay win_viewport until screen update #24182

Problem:
Sometimes, when nvim sends the `win_viewport` event, for example when scrolling
with visible folds on the screen, it reports the `scroll_delta` value one batch
into "future". So when the client application is trying to show the new viewport
it's not yet updated, resulting in temporary corruption / screen flickering.

For more details see #23609, and starting from [this comment](
https://github.com/neovide/neovide/pull/1790#issuecomment-1518697747) in
https://github.com/neovide/neovide/pull/1790,, where the issue was first
detected. Note that some of the conclusions in those are not fully accurate, but
the general observations are.

Solution:
When there are pending updates to a Window, delay the `win_viewport` UI event
until the updates are sent. This ensures that there's no flush between sending
the viewport and updating of the lines corresponding to the new viewport.

Document the existing viewport behaviour (for cases where there are no
extra flushes), give a hint about how applications can deal with the slightly
surprising behaviour of the viewport event being sent after the updates.

Fixes https://github.com/neovim/neovim/issues/23609
2023-07-25 05:37:07 -07:00
Mike
c0c6294123 fix(fs.lua): normalize slash truncation
Preserve last slash in windows' root drive directories

(cherry picked from commit 886996ff74)
2023-07-18 06:36:24 +00:00
Kai Ting
65d9407835 clipboard: suppression exit warning if exit code is >= 128
This is a matching change to 939d9053bd

Fixes: 7054
(cherry picked from commit 62b5d66e43)
2023-07-16 14:24:57 +00:00
Sean Dewar
6808f47ec5 fix(tutor): don't use concealed text in expected lines
(cherry picked from commit 24c3962a2e)
2023-07-11 17:11:07 +00:00
Ricky Zhou
08ae485984 fix(ui): propagate line wrapping state on grid_line events
This fixes the TUI's line-wrapping behavior, which was broken with the
migration to the msgpack-based UI protocol (see
https://github.com/neovim/neovim/issues/7369#issuecomment-1571812273).

(cherry picked from commit 981acc2922)
2023-07-03 21:07:38 +00:00
Christian Clason
657072fc62 fix(ftplugin): respect runtimepath ordering
Problem: bundled `ftplugin/foo/*.vim` are sourced before user
`ftplugin/foo.vim`.

Solution: call `runtime!` once on all patterns to be sourced.

Followup to #23801. Fixes #24003.

(cherry picked from commit 502a7a0558)
2023-06-30 10:22:24 +00:00
github-actions[bot]
b9a513ae11
[Backport release-0.9] fix(fs): make normalize() work with '/' path (#24060)
fix(fs): make `normalize()` work with '/' path

Problem: Current implementation of "remove trailing /" doesn't
account for the case of literal '/' as path.
Solution: Remove trailing / only if it preceded by something else.

(cherry picked from commit 80ff66118a)

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2023-06-19 02:01:12 -07:00
github-actions[bot]
0f121fea81
[Backport release-0.9] fix(codelens): add buffer and line checks before displaying codelens (#24014)
fix(codelens): add buffer and line checks before displaying codelens

(cherry picked from commit 928dc33053)

Co-authored-by: Rohit Sukumaran <rohit.sukumaran@kredx.com>
2023-06-13 19:55:00 +02:00
zeertzjq
abed0acf56 fix(remote): restore previous --remote-expr output formatting
- Use tostring() as that's what print() uses internally.
- Do not append trailing new line.

(cherry picked from commit b6d89de60e)
2023-06-11 14:12:51 +00:00
zeertzjq
4dafd5341a fix(remote): make --remote-expr print to stdout
(cherry picked from commit 54a05558e6)
2023-06-11 07:30:08 +00:00
Gregory Anders
d7212c10e2 fix(editorconfig): check that buffer is valid
Fixes: https://github.com/neovim/neovim/issues/23921
(cherry picked from commit 1cf3184f95)
2023-06-05 16:53:33 +00:00
Christian Clason
4892db22e2
fix(treesitter): remove incompatible c query (#23859)
`#has-parent?` and `#has-ancestor?` predicates were not backported
2023-06-02 11:53:40 +02:00
bfredl
7d4bba7aa7 NVIM 0.9.1
This is a maintenance release, consisting of bug fixes.

- checkhealth: Add shims for health functions (#23241)
- Add vim.lsp.buf.formatting_sync() to deprecated.txt
- treesitter: update parsers and queries
- api: Extmark highlight groups not always included in details
- api: Avoid assertion when autocmd group id is 0
- api: Don't change title when setting buffer in a window
- api: Nvim_get_hl should return default flag
- colorscheme: Try .lua files in 'rtp' before .vim files in 'pp'
- statuscolumn: fix issues when used with virt_lines and signs
- drawline: Make cursorlineopt=screenline work with resized grid
- eval: Prevent double-free in garbage collection
- extmarks: Don't show virt lines for end mark
- float: Make bufpos work properly with resized parent grid
- highlight: Add missing g: prefix for colors_name
- highlight: Combine ColorColumn with low-priority CursorLine
- highlight: Apply 'winblend' to NormalNC
- lua: Inspect_pos respect bufnr when get syntax info
- lua: Vim.split may trim inner empty items
- man.lua: Don't continue on command error
- man.lua: Return support of all sections
- mark: Properly init mark views
- messages: Ensure msg_grid is at top at more prompt
- mkspell: Prevent Unicode character overflow
- mouse: Cmdline click registered as statuscolumn
- mouse: Fix popup menu position check with winbar
- normal: Make "g$" work properly with resized grid
- pum: Show right-click menu above cmdline area
- pum: Position properly with multigrid and floats
- pum: Fix issues with with 'rightleft'
- redo: Make redo of Lua mappings in op-pending mode work
- redraw: Multibyte characters are wrapped at the end of a line
- redraw: Overwrite double-width char with virt_text properly
- ruler: Show ruler of curwin with no statusline in cmdline
- spell: Extmark with spell=false should disable spell
- statusline: Also allow right click when 'mousemodel' is "popup*"
- substitute: Properly check if preview is needed
- termdebug: Handle partial lines passed to callback
- tui: Position cursor at bottom-left before stopping
- tui: Redraw on SIGWINCH even if size didn't change
- tui: Grid_clear properly clears the screen
- tui: Fix title restore with title stack or altscreen
- ui: Send title to newly-attached UI
- windows: Set stdout to binary mode for --api-info
- windows: Revert installation context to per-machine
- build: Include all dependency directories when generating headers
2023-05-29 13:24:38 +02:00
github-actions[bot]
a1007597ca
[Backport release-0.9] fix(ftplugin): source Lua files after Vimscript files per directory (#23805)
fix(ftplugin): source Lua files after Vimscript files per directory

Problem: Lua ftplugins in runtime take precedence over Vimscript
ftplugins in user configs (even in `after/`).
Solution: Source ftplugins separately per directory, first Vimscript
then Lua.

(cherry picked from commit d2e4386991)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-05-28 15:23:51 +02:00
Christian Clason
a090be56bd
backport treesitter parser and queries (#23767) 2023-05-26 19:19:28 +02:00
zeertzjq
d34d987070 vim-patch:9.0.0138: not enough characters accepted for 'spellfile'
Problem:    Not enough characters accepted for 'spellfile'.
Solution:   Add vim_is_fname_char() and use it for 'spellfile'.

bc49c5f48f

Cherry-pick related doc update from Vim runtime.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 7e70a1e44b)
2023-05-26 03:44:11 +00:00
Christian Clason
c8d6d14f71
[Backport release-0.9] fix(treesitter): allow foldexpr without highlights (#23673)
fix(treesitter): allow foldexpr without highlights (#23672)

Ref nvim-treesitter/nvim-treesitter#4748

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-05-21 11:36:18 +02:00
github-actions[bot]
2be8c29406
[Backport release-0.9] fix(lsp): don't register didChangeWatchedFiles when capability not set (#23690)
fix(lsp): don't register didChangeWatchedFiles when capability not set

Some LSP servers (tailwindcss, rome) are known to request registration
for `workspace/didChangeWatchedFiles` even when the corresponding client
capability does not advertise support. This change adds an extra check
in the `client/registerCapability` handler not to start a watch unless
the client capability is set appropriately.

(cherry picked from commit 78510add5b)

Co-authored-by: Jon Huhn <huhnjon@gmail.com>
2023-05-20 08:01:52 +02:00
Christian Clason
17bdaeb79e vim-patch:9.0.1464: strace filetype detection is expensive
Problem:    Strace filetype detection is expensive.
Solution:   Match with a cheap pattern first. (Federico Mengozzi,
            closes vim/vim#12220)

6e5a9f9482

Co-authored-by: Federico Mengozzi <19249682+fedemengo@users.noreply.github.com>
(cherry picked from commit 9808866d57)
2023-05-10 07:05:51 +00:00
github-actions[bot]
1a104253df
[Backport release-0.9] fix(lsp): fix relative patterns for workspace/didChangeWatchedFiles (#23559)
fix(lsp): fix relative patterns for `workspace/didChangeWatchedFiles`

(cherry picked from commit 10f102a3a3)

Co-authored-by: Jon Huhn <huhnjon@gmail.com>
2023-05-09 18:23:22 +02:00
Vadim A. Misbakh-Soloviov
965f817ade fix(man.lua): return support of all sections
Current behaviour of `:Man` is to only work with "number" sections.
This is caused by wrong assumptions about man sections naming.

Also, there was similar assumption about length of section dirs
in `paths` variable.

fixes #23485

Signed-off-by: Vadim Misbakh-Soloviov <git@mva.name>
(cherry picked from commit 209ed16f57)
2023-05-08 08:09:54 +00:00
github-actions[bot]
c3d11208bc
[Backport release-0.9] perf(lsp): load buffer contents once when processing semantic tokens responses (#23505)
perf(lsp): load buffer contents once when processing semantic token responses

Using _get_line_byte_from_position() for each token's boundaries was a
pretty huge bottleneck, since that function would load individual buffer
lines via nvim_buf_get_lines() (plus a lot of extra overhead). So each
token caused two calls to nvim_buf_get_lines() (once for the start
position, and once for the end position).

For semantic tokens, we only attach to buffers that have already been
loaded, so we can safely just get all the lines for the entire buffer at
once, and lift the rest of the _get_line_byte_from_position()
implementation directly while bypassing the part that loads the buffer
line.

While I was looking at get_lines (used by _get_line_byte_from_position),
I noticed that we were checking for non-file URIs before we even looked
to see if we already had the buffer loaded. Moving the buffer-loaded
check to be the first thing done in get_lines() more than halved the
average time spent transforming the token list into highlight ranges vs
when it was still using _get_line_byte_from_position. I ended up
improving that loop more by not using get_lines, but figured the
performance improvement it provided was worth leaving in.

(cherry picked from commit dc38eafab5)

Co-authored-by: John Drouhard <john@drouhard.dev>
2023-05-06 12:10:49 +02:00
github-actions[bot]
fe261706a2
[Backport release-0.9] perf(treesitter): insert/remove items efficiently (#23504)
perf(treesitter): insert/remove items efficiently

(cherry picked from commit c8fdc57b88)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-05-06 12:10:35 +02:00
github-actions[bot]
1b09bcef52
[Backport release-0.9] fix(treesitter): redraw added/removed injections properly (#23408)
fix(treesitter): redraw added/removed injections properly

When injections are added or removed make sure to:
- invoke 'changedtree' callbacks for when new trees are added.
- invoke 'changedtree' callbacks for when trees are invalidated
- redraw regions when languagetree children are removed

(cherry picked from commit b68157834a)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-05-06 11:55:51 +02:00
github-actions[bot]
76dd0f81b0
[Backport release-0.9] fix(treesitter): do not calc folds on unloaded buffers (#23440)
fix(treesitter): do not calc folds on unloaded buffers

Fixes #23423

(cherry picked from commit 2e08228a16)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-05-02 11:23:45 +01:00
github-actions[bot]
f77b2740ee
[Backport release-0.9] docs(lsp): remove vim.lsp.sync (#23419)
docs(lsp): remove vim.lsp.sync

The module is used internally and not intended to be used by plugins or
users.

(cherry picked from commit 02d5a678fb)

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2023-05-01 11:51:30 +02:00
github-actions[bot]
98a90abca9
[Backport release-0.9] perf(lsp): process semantic tokens response in a coroutine that yields every 5ms (#23414)
perf(lsp): process semantic tokens response in a coroutine that yields every 5ms

(cherry picked from commit 46cd1d957c)

Co-authored-by: John Drouhard <john@drouhard.dev>
2023-05-01 07:27:44 +02:00
zeertzjq
5c2f442a74 vim-patch:8.2.3509: undo file is not synced
Problem:    Undo file is not synced. (Sami Farin)
Solution:   Sync the undo file if 'fsync' is set. (Christian Brabandt,
            closes vim/vim#8879, closes vim/vim#8920)

340dd0fbe4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit ff5b103ac7)
2023-04-28 13:07:22 +00:00
Justin M. Keyes
127a483142 refactor(lua): simplify vim.gsplit impl
(cherry picked from commit 824766612d)
2023-04-21 12:05:39 +00:00
Justin M. Keyes
2363d44d5a fix(lua): vim.split may trim inner empty items
Problem:
`vim.split('a:::', ':', {trimempty=true})` trims inner empty items.
Regression from 9c49c10470

Solution:
Set `empty_start=false` when first non-empty item is found.
close #23212

(cherry picked from commit 622b1ae38a)
2023-04-21 12:05:39 +00:00
dundargoc
df3982e704
feat(checkhealth): add shims for health functions (#23241)
This is for plugins wanting to support many versions of neovim.
2023-04-21 13:39:03 +02:00
github-actions[bot]
ef7513c87f
[Backport release-0.9] fix(treesitter playground): fix the wrong range of a node displayed i… (#23220)
fix(treesitter playground): wrong range of a node displayed in playground

The call parameters order of the function `get_range_str` is flipped for the last two arguments compared to the declaration.

(cherry picked from commit 8613ba118c)

Co-authored-by: William <50717946+BIKA-C@users.noreply.github.com>
2023-04-20 18:30:56 +02:00
github-actions[bot]
a41930bcf0
[Backport release-0.9] fix(watchfiles): skip Created events when poll starts (#23197)
fix(watchfiles): skip Created events when poll starts

(cherry picked from commit 8ca1bae217)

Co-authored-by: Jon Huhn <huhnjon@gmail.com>
2023-04-19 16:55:06 +02:00
github-actions[bot]
535d8553c4
[Backport release-0.9] fix(loader): reset hashes when running the loader (#23181)
fix(loader): only keep hashes for the current loop iteration

(cherry picked from commit e12cfa567f)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-04-18 17:08:45 +02:00
Raphael
79ee63bc36 fix(lua): inspect_pos respect bufnr when get syntax info
(cherry picked from commit ee4d1f9c52)
2023-04-16 09:50:49 +00:00
zeertzjq
eb9a95ea8e docs: add vim.lsp.buf.formatting_sync() to deprecated.txt
(cherry picked from commit d5b8a1b3d3)
2023-04-12 14:52:24 +00:00
github-actions[bot]
2e819d3707
[Backport release-0.9] fix(runtime): add commentstring for C# ftplugin (#23041)
fix(runtime): add commentstring for C# ftplugin

Problem: No commentstring is set for C# buffers after removing the
default C-style commentstring

Solution: Add `ftplugin/cs.lua` with C-style commentstring
(cherry picked from commit 15c3f2da30)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-04-12 14:01:46 +02:00
github-actions[bot]
702621f058
[Backport release-0.9] fix(treesitter): Use the correct replacement args for #gsub! directive (#23018)
fix(treesitter): use the correct replacement args for #gsub! directive

(cherry picked from commit 07db1f7432)

Co-authored-by: scottming <therealscottming@gmail.com>
2023-04-11 10:40:43 +02:00