Commit Graph

30630 Commits

Author SHA1 Message Date
zeertzjq
8010d1c0ed vim-patch:7866d54: runtime(vim): Update base-syntax, match :loadkeymap after colon and bar
Match :loadkeymap after Ex colons and bars.

Don't generate :loadkeymap as it is matched with a custom syntax group.

closes: vim/vim#15554

7866d54ecc

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-08-24 07:41:28 +08:00
zeertzjq
8f9669a27c vim-patch:7884cc7: runtime(vim): Update base-syntax, improve :let-heredoc highlighting
The end marker is not required to match the indent of :let when "trim"
is specified, it may also appear without leading whitespace as normal.

closes: vim/vim#15564

7884cc7418

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-08-24 07:39:56 +08:00
zeertzjq
6af9ca4926
vim-patch:95e9078: runtime(vim): Improve heredoc handling for all embedded scripts (#30121)
* Improve heredoc handling
  - Support "trim" for all the embedded scripts.
  - Check the indent of "trim" for "let" and all the embedded scripts.
* Update missing part of vim.vim.base in the commit
  d164f2a521f8e52e587727657fb1c19e9a25f32a.
* Update gen_syntax_vim.vim to catch up with 9.1.0685's source code.

closes: vim/vim#15542

95e90781a4

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-08-23 09:56:29 +08:00
Christian Clason
3b32869ced vim-patch:2750b83: runtime(java): Make the bundled &foldtext function optional
- Obtain and pass through translated messages with this
  function.
- If "g:java_foldtext_show_first_or_second_line" is defined,
  assign this function to &foldtext.

closes: vim/vim#15549

2750b83fa1

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-22 23:45:48 +02:00
Christian Clason
8db8793503 vim-patch:c75dad0: runtime(netrw): Change line on mx if command output exists
closes: vim/vim#15550

c75dad0177

Co-authored-by: yasuda <yasuda@kyoto-sr.co.jp>
2024-08-22 23:45:48 +02:00
Christian Clason
916237d9b5 vim-patch:38cfa2b: runtime(netrw): Fix mf-selected entry highlighting
closes: vim/vim#15551

38cfa2b662

Co-authored-by: yasuda <yasuda@kyoto-sr.co.jp>
2024-08-22 23:45:48 +02:00
Christian Clason
8c405d9b34 vim-patch:0e9fd77: runtime(htmlangular): add html syntax highlighting
fixes: vim/vim#15459
closes: vim/vim#15552

0e9fd7755d

Co-authored-by: Dennis van den Berg <dennis.vandenberg@nedap.com>
2024-08-22 23:45:48 +02:00
glepnir
1f5bcc7c4e
feat(lsp): completion opts support custom item conversion (#30060)
Problem: Some items of completion results include function signatures that can
cause the pum to be very long when a function has many params, because pum
scales with the longest word/abbr.

Solution: add custom covert function that can customise abbr to remove params.
2024-08-22 21:42:27 +02:00
glepnir
e48179f31e
fix(lsp): suppress completion request if completion is active (#30028)
Problem: the autotrigger mechanism could fire completion requests despite
completion already being active from another completion mechanism or manual
trigger

Solution: add a condition to avoid an additional request.
2024-08-22 09:51:44 +02:00
zeertzjq
3bd7492a69
vim-patch:bc29ea6: runtime(zip): simplify condition to detect MS-Windows (#30115)
related: vim/vim#15519

bc29ea6286

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-22 05:58:22 +08:00
zeertzjq
362389eb15
vim-patch:9.1.0683: mode() returns wrong value with <Cmd> mapping (#30109)
Problem:  mode() returns wrong value with <Cmd> mapping
Solution: Change decision priority of VIsual_active and move
          visual mode a bit further down (kuuote)

closes: vim/vim#15533

0fd1cb1b1f

Co-authored-by: kuuote <znmxodq1@gmail.com>
2024-08-22 05:30:21 +08:00
Christian Clason
4e5607eb37 build(deps): bump luajit to HEAD - c68711cc8 2024-08-21 12:57:18 +02:00
Christian Clason
a691858326 vim-patch:5f5f283: runtime(pandoc): escape quotes in &errorformat for pandoc
closes: vim/vim#15535

5f5f2832f5

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-08-21 09:14:17 +02:00
Christian Clason
78e48cd9b5 vim-patch:d55e698: runtime(pandoc): refine pandoc compiler settings
closes: vim/vim#15529

d55e698fa0

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-08-21 09:14:17 +02:00
zeertzjq
6f7bb02e7f
vim-patch:9.1.0686: zip-plugin has problems with special characters (#30108)
Problem:  zip-plugin has problems with special characters
          (user202729)
Solution: escape '*?[\' on Unix and handle those chars
          a bit differently on MS-Windows, add a test, check
          before overwriting files

runtime(zip): small fixes for zip plugin

This does the following:
- verify the unzip plugin is executable when loading the autoload plugin
- handle extracting file names with '[*?\' in its name correctly by
  escaping those characters for the unzip command (and handle those
  characters a bit differently on MS-Windows, since the quoting is different)
- verify, that the extract plugin is not overwriting a file (could cause
  a hang, because unzip asking for confirmation)
- add a test zip file which contains those special file names

fixes: vim/vim#15505
closes: vim/vim#15519

7790ea0c68

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-20 23:35:27 +00:00
zeertzjq
a9e11168f5
Merge pull request #30095 from zeertzjq/vim-175a87c
vim-patch: update :keeppatterns doc
2024-08-21 07:20:59 +08:00
zeertzjq
9f49529627 vim-patch:e44e644: runtime(doc): fix grammar in :h :keeppatterns
- It's clear that :s and :& are Ex commands, so remove "command" along
  with the duplicate "the".
- Use "or" instead of "and" following "without".

closes: vim/vim#15527

e44e64492c
2024-08-21 07:03:55 +08:00
zeertzjq
9639552572 vim-patch:3840d2f: runtime(doc): remove trailing whitespace in cmdline.txt
3840d2feaf

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-21 07:02:23 +08:00
zeertzjq
abd1b1ff42 vim-patch:175a87c: runtime(doc): more clarification for the :keeppatterns needed
175a87c7f1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-21 07:02:23 +08:00
Christian Clason
41859c2d8c build(deps): bump luajit to HEAD - 304da39cc 2024-08-20 19:53:35 +02:00
atusy
fe5ae88b20
fix(lsp): update request name to capability map #30098
Add items based on specifications (<https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentClientCapabilities>)

- textDocument/documentColor
- textDocument/inlineValue
- textDocument/linkedEditingRange
- textDocument/moniker
- textDocument/onTypeFormatting
- textDocument/selectionRange
2024-08-20 06:37:03 -07:00
Rosen Stoyanov
8faa369791
docs(gen_help_html): wrap headings for narrow viewport #29903
Problem:
The headings and help tags overlap when browsing the docs in neovim.io/doc/user/ from a mobile phone.

Solution:
Apply the correct CSS rules so that the headings and help tags wrap
nicely below one another.
2024-08-20 05:56:37 -07:00
Ricardo Casía
766d503627
docs(lsp): annotate with vim.lsp.protocol.Methods enum #29521
Added the enum type annotation `vim.lsp.protocol.Methods` to provide some intellisense support.
2024-08-20 05:52:14 -07:00
Christian Clason
ac53996ebb build(deps): bump luajit to HEAD - fb22d0f80 2024-08-20 10:56:28 +02:00
zeertzjq
a8fbe1d409
fix(decor): don't use separate DecorSignHighlight for url (#30096) 2024-08-20 08:20:19 +08:00
ibhagwan
1d11808bfd
fix(terminal): interrupt/got_int hangs terminal (#30056)
Upon `terminal_enter`, `mapped_ctrl_c` is set in order to avoid `CTRL-C`
interrupts (which is proxied to the terminal process instead), `os_inchar`
will then test `mapped_ctrl_c` against `State` and set `ctrl_c_interrupts=false`
which prevents `process_ctrl_c` from setting `got_int=true` in a terminal
state.

However, if `got_int` is set outside of `process_ctrl_c`, e.g. via
`interrupt()`, this will hang the neovim process as `terminal_execute` will
enter an endless loop as `got_int` will never be cleared causing `safe_vgetc`
to always return `Ctrl_C`.

A minimal example reproducing this bug:
```vim
:autocmd TermEnter * call timer_start(500, {-> interrupt()})
:terminal
:startinsert
```

To fix, we make sure `got_int` is cleared inside `terminal_execute` when
it detects `Ctrl_C`.

Closes #20726

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-08-20 06:23:56 +08:00
Christian Clason
169f37b94f build(deps): bump luajit to HEAD - fb5e1c9f0 2024-08-19 19:33:02 +02:00
Gregory Anders
6d997f8068
fix(terminal): handle C0 characters in OSC terminator (#30090)
When a C0 character is present in an OSC terminator (i.e. after the ESC
but before a \ (0x5c) or printable character), vterm executes the
control character and resets the current string fragment. If the C0
character is the final byte in the sequence, the string fragment has a
zero length. However, because the VT parser is still in the "escape"
state, vterm attempts to subtract 1 from the string length (to account
for the escape character). When the string fragment is empty, this
causes an underflow in the unsigned size variable, resulting in a buffer
overflow.

The fix is simple: explicitly check if the string length is non-zero
before subtracting.
2024-08-19 06:43:06 -05:00
Gregory Anders
33464189bc
fix(vim.text): handle very long strings (#30075)
Lua's string.byte has a maximum (undocumented) allowable length, so
vim.text.hencode fails on large strings with the error "string slice too
long".

Instead of converting the string to an array of bytes up front, convert
each character to a byte one at a time.
2024-08-17 22:28:03 -05:00
Christian Clason
d1bdeacb00 vim-patch:8e25d91: runtime(dist): verify that executable is in $PATH
Otherwise, if the executable to be verified does not exist,
this would cause a false-positive in the 'IsSafeExecutable()' check,
because 'exepath(executable)' returns an empty string and
'fnamemodify('', ':p:h')' returns the current directory and as a result
the 'IsSafeExecutable()' returns false (for the wrong reason).

8e25d91cb7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-18 01:19:01 +02:00
zeertzjq
cce1eb0806
fix(api): error properly with invalid field in nvim_open_win (#30078) 2024-08-17 23:10:27 +00:00
Christian Clason
b0a042e877 vim-patch:6908db4: runtime(colors): update colorschemes
- all: PMenuMatch and PMenuMatchSel for 8c/16c
- habamax:
    - revert VertSplit to solid background color
    - remove gitCommitSummary link to Title
    - make TabLineFill same as StatuslineNC

closes: vim/vim#15506

6908db4756

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-17 13:03:13 +02:00
Christian Clason
77380e1601 vim-patch:c6ed816: runtime(yaml): do not re-indent when commenting out lines
It's a personal annoyance for me. I have to edit yaml files on a lot of
customer environments and whenever you type '#' at the start of the
line, the commented line will be indented by whatever indent the
previous line had.

I hate this seriously, because it makes un-commenting painful. So let's
fix this. But instead of messing with the indent function, let's just
remove the '0#' from cinkeys, so that Vim won't perform re-indenting
when commenting out such a yaml file.

closes: vim/vim#15494

c6ed816761

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-17 13:03:13 +02:00
Christian Clason
550ddef366 vim-patch:1fbccc1: runtime(netrw): Drop committed trace lines
closes: vim/vim#15501

1fbccc1e96

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-17 13:03:13 +02:00
Christian Clason
68eceb8058 vim-patch:b4d1164: runtime(netrw): Error popup not always used
Problem:  g:netrw_use_errorwindow=2 does not work
          without +balloon_eval.
Solution: Check for popup_atcursor().

related: vim/vim#15501

b4d1164425

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-17 13:03:13 +02:00
Christian Clason
de68077545 vim-patch:7c75411: runtime(netrw): ErrorMsg() may throw E121
Move variables declaration

related: vim/vim#15501

7c754110ff

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-17 13:03:13 +02:00
Christian Clason
0c3bdb80bd vim-patch:a1dc649: runtime(dosbatch): Show %%i as an argument in syntax file
Inside batch files, for-variables must be written as %%i, not %i.

closes: vim/vim#15453

a1dc64956f

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-08-17 13:03:13 +02:00
Christian Clason
78fb387f87 vim-patch:11c92be: runtime(dosbatch): Add syn-sync to syntax file
Closing parentheses were often highlighted as errors.
Add a syntax sync command to reduce the error.

Also fix that `defined` was not highlighted as an operator inside
parentheses.  E.g.:
```
if defined foo (
    if defined bar (
        ...
    )
)
```
The first `defined` was highlighted but the second one was not.

related: vim/vim#15453

11c92be897

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-08-17 13:03:13 +02:00
Christian Clason
89df96b5cf vim-patch:dd36d6c: runtime(mediawiki): fix typo in doc, test for b:did_ftplugin var
closes: vim/vim#15479

dd36d6cc7c

Co-authored-by: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com>
2024-08-17 13:03:13 +02:00
zeertzjq
172cc23d88
vim-patch:d164f2a: runtime(vim): Update base-syntax, improve :let-heredoc highlighting (#30069)
The end marker must appear on line of its own without any trailing
whitespace.

Whitespace is incorrectly allowed before all end markers.  Limiting this
only to heredocs where "trim" was specified, and with the correct
indent, is currently an intractable problem given that contained syntax
groups (in this case :let) cannot be limited to start patterns.

Highlight interpolated expressions when "eval" is specified.

cloess: vim/vim#15511

d164f2a521

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-08-16 23:09:39 +00:00
zeertzjq
d698b3acca
Merge pull request #30066 from zeertzjq/vim-9.1.0677
vim-patch: :keepp does not retain last substitute string
2024-08-17 07:04:10 +08:00
zeertzjq
a837f10d17 vim-patch:cba93ca: runtime(doc): clarify the effect of :keeppatterns after v9.1.0677
cba93cab53
2024-08-17 06:35:42 +08:00
zeertzjq
a25dbeee10 vim-patch:9.1.0677: :keepp does not retain the substitute pattern
Problem:  :keeppatterns does not retain the substitute pattern
          for a :s command
Solution: preserve the last substitute pattern when used with the
          :keeppatterns command modifier (Gregory Anders)

closes: vim/vim#15497

3b59be4ed8

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-08-17 06:34:59 +08:00
zeertzjq
4afd4061a2
Merge pull request #30068 from zeertzjq/vim-9.1.0678
vim-patch:9.1.{0678,0679}
2024-08-17 06:33:13 +08:00
zeertzjq
7df6fbb096 vim-patch:9.1.0679: Rename from w_closing to w_locked is incomplete
Problem:  Rename from w_closing to w_locked is incomplete
          (after 9.1.0678).
Solution: Rename remaining occurrences of w_closing to w_locked and
          update comments (zeertzjq).

closes: vim/vim#15504

bc11f6d9d4
2024-08-17 06:04:52 +08:00
zeertzjq
b3d291c565 vim-patch:9.1.0678: [security]: use-after-free in alist_add()
Problem:  [security]: use-after-free in alist_add()
          (SuyueGuo)
Solution: Lock the current window, so that the reference to
          the argument list remains valid.

This fixes CVE-2024-43374

0a6e57b09b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-17 06:04:52 +08:00
Eduardo Rittner Coelho
8b8096500d
fix(tutor): incorrect lines marked as correct #29833
Problem: In line 308 the poem appears as

1)  Roses are red,
2)  Mud is fun,
3)  Violets are blue,
4)  I have a car,
5)  Clocks tell time,
6)  Sugar is sweet
7)  And so are you.

where the wrong lines (2, 4, 5) are all marked as correct.

Solution: Change the tutor.json file so that initially the poem appears
as

1)  Roses are red,
2)  Mud is fun,
3)  Violets are blue,
4)  I have a car,
5)  Clocks tell time,
6)  Sugar is sweet
7)  And so are you.

The method for checking whether a line is correct or not is really
simple, so I couldn't find a way to display the 6th line as initially
correct, however upon deleting lines 2, 4 and 5 the final result shows
line 6 as correct.
2024-08-16 10:35:13 -07:00
Maria José Solano
a901fb875f
fix(docs): add missing properties to hl_info #30032 2024-08-16 08:36:23 -07:00
Lewis Russell
fd65422b99 feat(diff): do not try external when out of memory
- Also merge diff_buf_idx_tp into diff_buf_idx.
2024-08-15 19:46:52 +01:00
zeertzjq
ee5aaba215
fix(man): avoid setting v:errmsg (#30052) 2024-08-15 22:02:20 +08:00