Commit Graph

25708 Commits

Author SHA1 Message Date
Jaehwang Jung
52669b5c69 fix(diff): filler lines for hunks bigger than linematch limit
Apply linematch filler computation only if the hunk is actually
linematched.

Fixes #24580

(cherry picked from commit ed1da3ac24)
2023-08-12 09:14:54 +00:00
zeertzjq
211db74a31 vim-patch:9.0.1694: wrong mapping applied when replaying a char search
Problem: wrong mapping applied when replaying a char search
Solution: Store a NOP after the ESC

closes: vim/vim#12708
closes: vim/vim#6350

bacc83009b
(cherry picked from commit c3d853cb89)
2023-08-12 07:12:59 +08:00
zeertzjq
79067685ab vim-patch:9.0.1687: mapset() not properly handling script ID
Problem: mapset() not properly handling script ID
Solution: replace_termcodes() may accept a script ID

closes: vim/vim#12699
closes: vim/vim#12697

7e0bae024d
(cherry picked from commit 526d2d40f6)
2023-08-12 07:02:07 +08:00
Christian Clason
1cd08f242f
Merge pull request #24649 from neovim/backport-24595
Backport #24595 to release-0.9
2023-08-10 18:50:39 +02: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
zeertzjq
bedd4bd746
Merge pull request #24576 from neovim/backport-24575-to-release-0.9
[Backport release-0.9] fix(inccommand): don't set an invalid 'undolevels' value
2023-08-05 22:56:47 +08:00
zeertzjq
06ec1a49d7 fix(inccommand): don't set an invalid 'undolevels' value
Problem:    Cannot break undo by setting 'undolevels' to itself in
            'inccommand' preview callback.
Solution:   Don't set an invalid 'undolevels' value.

Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
(cherry picked from commit 7c5e7d831a)
2023-08-05 14:42:55 +00: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
5e6c8b3385
Merge pull request #24554 from zeertzjq/backport
Backport libvterm bump to release-0.9
2023-08-04 10:57:24 +08:00
zeertzjq
9d1c8bc5c0
Merge pull request #24555 from neovim/backport-23224-to-release-0.9
[Backport release-0.9] refactor(env): remove unused mutex
2023-08-04 10:51:40 +08:00
bfredl
e977f3dd4f refactor(env): remove unused mutex
This was needed when TUI was a thread.
lua code uses os_getenv only on the main thread.

(cherry picked from commit b773a52515)
2023-08-04 02:41:55 +00:00
zeertzjq
060886e16c fix(terminal): forward horizontal mouse scrolling 2023-08-04 10:34:55 +08:00
zeertzjq
241d649c23 build(deps): bump libvterm to 0.3.3
Fix #21106
2023-08-04 10:34:22 +08:00
zeertzjq
f237c92076
Merge pull request #24551 from neovim/backport-24549-to-release-0.9
[Backport release-0.9] fix(terminal): include modifiers when forwarding mouse
2023-08-04 10:15:58 +08:00
zeertzjq
90b1a3250a fix(terminal): include modifiers when forwarding mouse
(cherry picked from commit d7da156929)
2023-08-04 01:34:34 +00:00
zeertzjq
ff689ed1a9
Merge pull request #24505 from zeertzjq/backport
Backport to release-0.9
2023-07-28 16:28:04 +08:00
zeertzjq
f33d49a7a7 fix(inccommand): don't save information of a buffer twice
Problem:    'inccommand' doesn't restore 'undolevels' properly for a
            buffer shown in multiple windows.
Solution:   Don't save information of a buffer twice.
2023-07-28 16:09:15 +08:00
zeertzjq
d0a6c1437d test: reduce flakiness
Avoid consecutive RPC requests involving :startinsert or :stopinsert,
because consecutive RPC requests may be processed together, before the
:startinsert or :stopinsert takes effect.

Also change some feed_command() to command() to make tests faster.
2023-07-28 15:57:57 +08:00
zeertzjq
9f6fc24bcb test: check that TextChangedT cannot delete terminal buffer 2023-07-28 15:57:57 +08:00
zeertzjq
c03d38c51d test: check real cursor position in Terminal mode 2023-07-28 15:57:57 +08:00
zeertzjq
bde56f4e37
Merge pull request #24503 from zeertzjq/backport
Backport of #24289 and #24489 to release-0.9
2023-07-28 15:40:27 +08:00
zeertzjq
1fdb41969f test(inccommand): add a test for #20248 2023-07-28 15:21:37 +08:00
Alexandre Teoi
1e905c52ca fix(inccommand): restrict cmdpreview undo calls
Problem:
The cmdpreview saved undo nodes on cmdpreview_prepare() from ex_getln.c may
become invalid (free) if the preview function makes undo operations, causing
heap-use-after-free errors.

Solution:
Save the buffer undo list on cmdpreview_prepare)_ and start a new empty one. On
cmdpreview_restore_state(), undo all the entries in the new undo list and
restore the original one. With this approach, the preview function will be
allowed to undo only its own changes.

Fix #20036
Fix #20248
2023-07-28 15:20:58 +08:00
zeertzjq
b31b01cac2
Merge pull request #24486 from zeertzjq/backport
Backport to release-0.9
2023-07-26 03:09:27 +08:00
Brandon Simmons
46301281f7 fix(folds): update folds in Insert mode with fdm=indent
Previously, when using foldmethod=indent, inserting an unindented line
would inadvertently open closed folds below it.
As a performance improvement, folds were only updated once, across all
lines, after Insert mode was exited.

Now, the performance improvement is no longer being used when
foldmethod=indent, so folds are updated multiple times during Insert
mode, but only across the lines that are changing, which preserves the
folds (and their open/close states) instead of recreating them.
2023-07-25 22:56:02 +08:00
zeertzjq
d6733abc69 fix(ui-ext): backport win_viewport fixes to release-0.9 2023-07-25 22:56:02 +08:00
zeertzjq
42a735e524 fix(startup): don't truncate when printing with -l 2023-07-25 22:56:02 +08:00
zeertzjq
ada9443999 fix(mouse): handle folded lines with virt_lines attached to line above 2023-07-25 22:56:02 +08:00
zeertzjq
69f11f6d26 fix(plines): folded lines with virt_lines attached to line above 2023-07-25 22:56:02 +08:00
zeertzjq
badb6f4bc3 vim-patch:9.0.1607: screenpos() returns wrong row with diff filler lines
Problem:    screenpos() returns wrong row with diff filler lines.
Solution:   Only add filler lines when appropriate.  Also don't add the
            'smoothscroll' marker when w_skipcol is zero. (closes vim/vim#12485,
            closes vim/vim#12484)

55daae3921
2023-07-25 22:56:02 +08:00
zeertzjq
0afec352da vim-patch:9.0.1600: screenpos() does not take w_skipcol into account
Problem:    screenpos() does not take w_skipcol into account.
Solution:   Subtract w_skipcol from column. (closes vim/vim#12486, closes vim/vim#12476)

f0e68c0e2a
2023-07-25 22:56:01 +08:00
zeertzjq
1da1e5a4f3
Merge pull request #24484 from neovim/backport-24481-to-release-0.9
[Backport release-0.9] test(core/startup_spec): use retry() instead of jobwait()
2023-07-25 20:48:04 +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
zeertzjq
d1a7aaa7f2 test(core/startup_spec): use retry() instead of jobwait()
This should work on Windows.

(cherry picked from commit 9ade0702b6)
2023-07-25 12:33:21 +00:00
zeertzjq
76bbfb3cfd
Merge pull request #24479 from neovim/backport-24477-to-release-0.9
[Backport release-0.9] fix(startup): make recovery mode work without --headless
2023-07-25 19:46:52 +08:00
zeertzjq
11e90126ba fix(startup): make recovery mode work without --headless
(cherry picked from commit e483d95289)
2023-07-25 11:28:42 +00:00
zeertzjq
aefacff567
Merge pull request #24478 from neovim/backport-23910-to-release-0.9
[Backport release-0.9] test(core/startup_spec): add a test for #13720
2023-07-25 19:23:32 +08:00
zeertzjq
cba4362d85 test(core/startup_spec): add a test for #13720
(cherry picked from commit 3cd69055de)
2023-07-25 11:11:31 +00:00
zeertzjq
8dd4a2bdd1
Merge pull request #24476 from neovim/backport-24425-to-release-0.9
[Backport release-0.9] fix(terminal): call validate_cursor to update the viewport
2023-07-25 11:44:24 +08:00
Fred Sundvik
dc2860d821 fix(terminal): call validate_cursor to update the viewport
(cherry picked from commit 0f5f0dd07b)
2023-07-25 03:26:05 +00:00
zeertzjq
78b39d510a
Merge pull request #24463 from neovim/backport-24462-to-release-0.9
[Backport release-0.9] fix(mouse): drag vsep of window with 'statuscolumn'
2023-07-24 18:29:12 +08:00
zeertzjq
16e690d595 fix(mouse): drag vsep of window with 'statuscolumn'
Problem:    Cannot drag a vertical separator to the right of a window
            whose 'statuscolumn' is wider than itself.
Solution:   Never treat a click on a vertical separator as a click on
            'statuscolumn'.
(cherry picked from commit c0007e6300)
2023-07-24 10:17:14 +00:00
zeertzjq
740cb0c7dd
Merge pull request #24460 from neovim/backport-24459-to-release-0.9
[Backport release-0.9] fix(statuscolumn): don't update clicks if current width is 0
2023-07-24 15:32:33 +08:00
zeertzjq
48d5eaffcd fix(statuscolumn): don't update clicks if current width is 0
(cherry picked from commit f46241d8a8)
2023-07-24 07:18:44 +00:00
zeertzjq
af1da51d11
Merge pull request #24449 from neovim/backport-24448-to-release-0.9
[Backport release-0.9] fix(highlight): make CurSearch work properly with 'winhl'
2023-07-23 21:56:01 +08:00
zeertzjq
e2d14926d7 fix(highlight): make CurSearch work properly with 'winhl'
(cherry picked from commit 56d7627e1a)
2023-07-23 13:37:43 +00:00
zeertzjq
a3889e743f
Merge pull request #24439 from neovim/backport-24438-to-release-0.9
[Backport release-0.9] test: fix VimResume test flakiness
2023-07-23 10:14:06 +08:00
zeertzjq
8ac7491685 test: fix VimResume test flakiness
(cherry picked from commit 95c3f8be68)
2023-07-23 02:03:28 +00:00
zeertzjq
776a9b59b6
Merge pull request #24434 from neovim/backport-24426-to-release-0.9
[Backport release-0.9] fix(events): trigger VimResume on next UI request
2023-07-23 07:31:07 +08:00
zeertzjq
e8ff921ed3 fix(events): trigger VimResume on next UI request
(cherry picked from commit cdd076d6c1)
2023-07-22 23:17:02 +00:00