Commit Graph

27044 Commits

Author SHA1 Message Date
zeertzjq
0c86828ac5
fix(ui): avoid ambiguity about chunk that clears part of line (#24982)
Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-09-02 18:50:12 +08:00
Lewis Russell
bb1df1221d
Merge pull request #24310 from lewis6991/refactor/optionvalidate
refactor(option.c): misc
2023-09-02 10:37:15 +01:00
Christian Clason
f02bfb6a2a vim-patch:acb91d3905cf
runtime(zserio): add zserio syntax (vim/vim#13005)

acb91d3905

Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
2023-09-02 11:08:29 +02:00
Christian Clason
61ccdb2db6 vim-patch:da16a1b471aa
runtime(ruby): Update syntax, indent and ftplugin files

While making changes to the ruby ftplugin, slightly change the exepath()
conditional from patch 9.0.1833 and move it after the :cd invocation.

closes: 12981
closes: 12994

da16a1b471

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Tim Pope <code@tpope.net>
2023-09-02 11:08:29 +02:00
zeertzjq
bc43575c52
test(shada/marks_spec): load the file with the marks (#24979) 2023-09-02 10:23:43 +08:00
bfredl
b028233991 fix(memline): more curbuf stuff 2023-09-01 19:28:26 +02:00
TheBlob42
597355deae
fix(lsp): wrong iterator in registerCapability handler (#24971) 2023-09-01 13:31:05 +02:00
zeertzjq
7bf0963d48
vim-patch:9.0.1833: [security] runtime file fixes (#24969)
Problem:  runtime files may execute code in current dir
Solution: only execute, if not run from current directory

The perl, zig and ruby filetype plugins and the zip and gzip autoload
plugins may try to load malicious executable files from the current
working directory.  This is especially a problem on windows, where the
current directory is implicitly in your $PATH and windows may even run a
file with the extension `.bat` because of $PATHEXT.

So make sure that we are not trying to execute a file from the current
directory. If this would be the case, error out (for the zip and gzip)
plugins or silently do not run those commands (for the ftplugins).

This assumes, that only the current working directory is bad. For all
other directories, it is assumed that those directories were
intentionally set to the $PATH by the user.

816fbcc262

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-01 11:38:31 +08:00
zeertzjq
592a8f1e90
vim-patch:9.0.1828: cursor wrong with virt text before double-width char (#24967)
Problem:  Wrong cursor position with virtual text before double-width
          char at window edge.
Solution: Check for double-width char before adding virtual text size.

closes: vim/vim#12977

ac2d8815ae
2023-09-01 06:45:27 +08:00
Lewis Russell
a1bec02c1e fix: use snprintf instead of sprintf
Clang 14 now reports sprintf as deprecated.
2023-08-31 15:12:35 +01:00
Lewis Russell
dd0e77d48a fix(query_error): multiline bug 2023-08-31 15:12:17 +01:00
Lewis Russell
90fd0864c4 refactor(option): add set_option() 2023-08-31 15:08:52 +01:00
Lewis Russell
038ac39b8e refactor(option): pass varp to set_string_option 2023-08-31 15:08:52 +01:00
Lewis Russell
af3c667ac1 refactor(option): option clearing 2023-08-31 15:08:52 +01:00
Lewis Russell
6a449a892b refactor(option): remove OPT_CLEAR 2023-08-31 15:08:52 +01:00
Lewis Russell
3a45a0db4d refactor(option): further align set_string_option with do_set_option_string (2) 2023-08-31 15:08:52 +01:00
Lewis Russell
ec0ca51886 refactor(option): further align set_string_option with do_set_option_string 2023-08-31 15:08:52 +01:00
Lewis Russell
9edd0f077e refactor(option): remove hidden option check 2023-08-31 15:08:50 +01:00
Lewis Russell
9a6b399cad refactor(option): remove redundant local 2023-08-31 15:08:02 +01:00
Lewis Russell
95c880ce31 refactor(option): change some int to bool 2023-08-31 15:07:05 +01:00
Lewis Russell
354a115442 refactor(option.c): call did_set_option for all types
set_option_value() only called did_set_option() for string options,
whereas do_set_option_value() called it for all types.

This change makes set_option_value() call did_set_option() for all types
and thus makes it more consistent with do_set_option_value().
2023-08-31 15:07:05 +01:00
Lewis Russell
804c828e68 fix(optionstr.c): incorrect use of curbuf/curwin 2023-08-31 15:07:05 +01:00
Lewis Russell
9fdc4cdb64 refactor(optionstr.c): remove redundant argument 2023-08-31 15:07:04 +01:00
Lewis Russell
3b02e1281a refactor(option.c): remove did_set_string_option alias 2023-08-31 15:07:04 +01:00
Lewis Russell
4b0b798eba refactor(option.c): move validation logic to function 2023-08-31 15:07:04 +01:00
Amaan Qureshi
845d5b8b64 feat(treesitter): improve query error message 2023-08-31 13:33:40 +01:00
Christian Clason
4afd33e69f vim-patch:0b8b145bf8bf
runtime(optwin): Fix for 'splitkeep' option (vim/vim#12974)

'spk' was used as a boolean, rather than a string option.

0b8b145bf8

Co-authored-by: xrandomname <141588647+xrandomname@users.noreply.github.com>
2023-08-31 10:58:54 +02:00
Christian Clason
2fad4c0b39 vim-patch:1610528cc305
runtime(forth): Update syntax and ftplugin files (vim/vim#12976)

1610528cc3

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-08-31 10:58:54 +02:00
Jongwook Choi
0e7e25af20
refactor(lsp): add type annotation for lsp.Client.server_capabilities (#24925)
The class `lsp.Client` has a public member `server_capabilities`,
which is assumed to be non-nil once initialized, as documented in
`:help vim.lsp.client`. Due to the possibility that it may be nil
before initialization, `lsp.Client` was not having a proper lua type
annotations on the field `server_capabilities`.

Instead of having a nil `server_capabilities` until initialized in
the RPC response callback, we can have an initial value of empty table.
This CHANGES the behavior of the `server_capabilities` field in a way
that it is no longer `nil` until initialization. Note that, as
already documented, `server_capabilities` should never be nil when
it is once initialized and thus ready to be used in user configs.
2023-08-31 10:14:20 +02:00
Chris AtLee
c235959fd9
fix(lsp): only disable inlay hints / diagnostics if no other clients are connected (#24535)
This fixes the issue where the LspNotify handlers for inlay_hint /
diagnostics would end up refreshing all attached clients.

The handler would call util._refresh, which called
vim.lsp.buf_request, which calls the method on all attached clients.

Now util._refresh takes an optional client_id parameter, which is used
to specify a specific client to update.

This commit also fixes util._refresh's handling of the `only_visible`
flag. Previously if `only_visible` was false, two requests would be made
to the server: one for the visible region, and one for the entire file.

Co-authored-by: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com>
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2023-08-31 10:00:24 +02:00
Maria José Solano
ee56daebb6
fix(shada): update deleted marks (#24936)
Fix #4295
Close #16067

Co-authored-by: chentau <tchen1998@gmail.com>
2023-08-31 10:15:49 +08:00
David Moberg
67fba9affa
fix(runtime/tutor): don't try to close fold when there is none (#24953)
Problem: When double clicking a line starting with a #, the code assumes
there is a fold there and tries to close it, resulting in an error if
there isn't a fold.
Solution: Check foldlevel before performing "zc".
2023-08-31 09:18:39 +08:00
zeertzjq
839d919098
vim-patch:9.0.1825: wrong cursor position with virt text and 'linebreak' (#24957)
Problem:  Wrong cursor position with virtual text before a whitespace
          character and 'linebreak'.
Solution: Always set "col_adj" to "size - 1" and apply 'linebreak' after
          adding the size of 'breakindent' and 'showbreak'.

closes: vim/vim#12956

6e55e85f92

N/A patches:
vim-patch:9.0.1826: keytrans() doesn't translate recorded key typed in a GUI
2023-08-31 08:35:08 +08:00
zeertzjq
5d49542b56
vim-patch:9.0.1820: Rexx files may not be recognised (#24956)
Problem:  Rexx files may not be recognised
Solution: Add shebang detection and improve disambiguation of *.cls
	  files

closes: vim/vim#12951

e06afb7860

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-31 08:20:00 +08:00
zeertzjq
7914881356
vim-patch:9.0.1797: Vimball/Visual Basic filetype detection conflict (#24947)
Problem:  Vimball/Visual Basic filetype detection conflict
Solution: runtime(vb): Improve Vimball and Visual Basic detection logic

Only run Vimball Archiver's BufEnter autocommand on Vimball archives.
Fixes vim/vim#2694.

closes: vim/vim#12899

f97f6bbf56

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-31 07:44:33 +08:00
zeertzjq
6463116818
vim-patch:9.0.1807: runtime: crystal scripts not recognised (#24949)
Problem:  runtime: crystal scripts not recognised
Solution: Filetype detect Crystal scripts by shebang line

closes: vim/vim#12935

9b73902dbe

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-31 04:38:28 +08:00
zeertzjq
497cf996eb
vim-patch:9.0.1803: runtime(filetype): Add norg language detection (#24948)
runtime(filetype): Add norg markup language detection

closes: vim/vim#12913

03e44a1d70

Co-authored-by: NTBBloodbath <bloodbathalchemist@protonmail.com>
2023-08-31 04:38:01 +08:00
Christian Clason
b2c3e9c72e vim-patch:9d8ef7cc4340
runtime: cleanup :Sman command via the undo_ftplugin mechanism (vim/vim#12967)

Regards to @dkearns as noticed in
2ac708b548

9d8ef7cc43

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2023-08-30 18:46:52 +02:00
Hongbo Liu
670c7609c8
fix(filetype): make sure buffer is valid before call nvim_buf_call (#24922) 2023-08-30 10:14:58 -05:00
bfredl
bec13cfcaf
Merge pull request #24944 from bfredl/memline0
fix(api): nvim_buf_get_offset in a new buffer with zero or one lines
2023-08-30 13:14:29 +02:00
bfredl
b051b131f5 fix(api): nvim_buf_get_offset in a new buffer with zero or one lines
fixes #24930
2023-08-30 12:01:35 +02:00
Lewis Russell
f85aa2e67f fix(treesitter.c): improve comments on fenv usage 2023-08-30 10:50:07 +01:00
Christian Clason
62869da11c build(deps): bump luajit to HEAD - 41fb94def 2023-08-30 10:03:19 +02:00
Christian Clason
3fcd6da5b0 vim-patch:2ac708b54866
runtime(sh): Update ftplugin (vim/vim#12950)

Remove :Help command via the undo_ftplugin mechanism.

2ac708b548

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-08-30 09:55:24 +02:00
Christian Clason
c4c5178b8e vim-patch:a5eb6785efcc
runtime(doc): mention special case of i_CTRL-R_-

closes: vim/vim#12947

a5eb6785ef

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-30 09:55:24 +02:00
Christian Clason
88bf4204ef vim-patch:3ac2d3da5fdf
runtime(heex): Add HEEX comments to match_words in ftplugin (vim/vim#12957)

3ac2d3da5f

Co-authored-by: Jason King <jk@handle.it>
2023-08-30 09:55:24 +02:00
Jongwook Choi
da7178cbbf fix(builtin): fix incorrect optional fields for fn.sign_define
The field `icon` is not a mandatory field.
2023-08-30 07:51:26 +01:00
bfredl
97cfee39ee
Merge pull request #24926 from bfredl/tsfree
fix(treesitter): fix another TSNode:tree() double free
2023-08-29 17:34:07 +02:00
bfredl
50a03c0e99 fix(treesitter): fix another TSNode:tree() double free
Unfortunately the gc=false objects can refer to a dangling tree if the
gc=true tree was freed first. This reuses the same tree object as the
node itself is keeping alive via the uservalue of the node userdata.
(wrapped in a table due to lua 5.1 restrictions)
2023-08-29 11:35:46 +02:00
Christian Clason
ae7ab90159 vim-patch:0382f05dbd65
runtime: Set b:undo_indent where missing (vim/vim#12944)

0382f05dbd

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-08-29 11:32:46 +02:00