Commit Graph

28349 Commits

Author SHA1 Message Date
Christian Clason
674f2513d4 fix(treesitter): validate language alias for injections
Problem: Parsed language annotations can be random garbage so
`nvim_get_runtime_file` throws an error.

Solution: Validate that `alias` is a valid language name before trying
to find a parser for it.
2024-01-18 15:46:08 +01:00
notomo
ab3a7fc3e3
docs(vim.iter): correct bool to boolean (#27018) 2024-01-18 07:01:57 -06:00
Justin M. Keyes
95cbedaa17
docs: various #25289
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
Co-authored-by: Oliver Marriott <hello@omarriott.com>
Co-authored-by: Benoit de Chezelles <bew@users.noreply.github.com>
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-01-18 00:14:48 -08:00
Christian Clason
11e8e14628 vim-patch:46d67d22b9ba
runtime(swayconfig): add focus_follows_mouse and smart_qaps syntax keywords

See:
0aceff7469/sway/sway.5.scd (L680)
`focus_follows_mouse yes|no|always`
0aceff7469/sway/sway.5.scd (L770)

closes: vim/vim#13797

46d67d22b9

Co-authored-by: James Eapen <james.eapen@vai.org>
2024-01-18 08:42:00 +01:00
Christian Clason
9b0b3cdc7a vim-patch:a39af0290496
runtime(i3config): remove always from `focus_follows_mouse`

The always option does not exist in i3, only sway.

From https://i3wm.org/docs/userguide.html:
`focus_follows_mouse yes|no`

Version number incremented by 2 because the last commit did not
increment the version.

a39af02904

Co-authored-by: James Eapen <james.eapen@vai.org>
2024-01-18 08:42:00 +01:00
Christian Clason
223a6afd8f vim-patch:6e5a6c9965f6
runtime(netrw): minor changes to fix move cmd on windows (vim/vim#13823)

6e5a6c9965

Co-authored-by: MiguelBarro <45819833+MiguelBarro@users.noreply.github.com>
2024-01-18 08:42:00 +01:00
zeertzjq
06aebfa998
vim-patch:9.0.1437: test fails with different error number (#27074)
Problem:    Test fails with different error number.
Solution:   Adjust the expected error.

3cdd799951

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-01-18 12:17:51 +08:00
zeertzjq
5b31447811
fix(drawline): update prev_ptr after getting syntax attrs (#27072) 2024-01-18 07:27:00 +08:00
zeertzjq
8a07ca6c4b
vim-patch:9.1.0040: issue with prompt buffer and hidden buffer (#27071)
Problem:  Modifying a hidden buffer still interferes with prompt buffer
          mode changes.
Solution: Save and restore b_prompt_insert.
          (zeertzjq)

closes: vim/vim#13875

Modifying hidden buffer still interferes with prompt buffer mode changes

f267847017
2024-01-18 07:23:48 +08:00
zeertzjq
780dd88b68
vim-patch:9.1.0039: too vague errors for 'listchars'/'fillchars' (#27070)
Problem:  too vague errors for 'listchars'/'fillchars'
Solution: Include the field name in error message.
          (zeertzjq)

related: #27050
closes: vim/vim#13877

6a8d2e1634

Co-authored-by: Cole Frankenhoff <cole.nhf@gmail.com>
2024-01-18 07:14:12 +08:00
altermo
5aa14e1231
fix(lua): return after assert returns assert message (#27064) 2024-01-17 13:34:25 -06:00
Sean Dewar
f5d59340a6
vim-patch:9b03d3e75b42 (#27059)
Translate the Vim9 script Godot files to legacy.

`<scriptcmd>` is not ported yet, so replace it with `<Cmd>` and `<SID>`.
If it's ported, `<scriptcmd>call s:` can be used instead.

Includes changes from:

vim-patch:0daafaa7d99e (was partial, but is now pretty much fully ported)
vim-patch:9712ff1288f9

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-01-17 14:47:40 +00:00
Lewis Russell
e855a80c72
Merge pull request #27024 from lewis6991/test_followup
test: big cleanup followup + typing
2024-01-17 13:46:55 +00:00
Luuk van Baal
d88814ef68 fix(column): remove sign from line it was previously on with undo 2024-01-17 13:39:42 +00:00
Christian Clason
4615d46f93 build(deps): bump tree-sitter-vimdoc to v2.1.0
Add support for `(note)`.
2024-01-17 13:07:55 +01:00
Luuk van Baal
f871fee8b6 fix(column): pass kFalse when initializing "b_signcols.count"
Problem:  Wrong "clear" argument passed to buf_signcols_count_range
          when initializing "b_signcols.count" for the first time.
Solution: Pass kFalse so that the "nested" counter is not incorrectly
          decremented.
2024-01-17 10:17:11 +00:00
Lewis Russell
14b7ffcf89 feat: add __call typing for vim.inspect() 2024-01-17 10:11:32 +00:00
Lewis Russell
587490217e test: fix mkdir() 2024-01-17 10:10:17 +00:00
Lewis Russell
13b83a3ea2 test: move format_{string,luav} to a separate module 2024-01-17 10:10:17 +00:00
Lewis Russell
b92318d67c test: improve helpers.argss_to_cmd() 2024-01-17 10:10:17 +00:00
Lewis Russell
c9240daf73 test: fix helpers.relpath()
Missing 3rd argument to string.gsub()
2024-01-17 10:10:17 +00:00
Lewis Russell
d735567fda test: simplify helpers.sysname() 2024-01-17 10:10:17 +00:00
Lewis Russell
26835d8d9c test: add type annotations 2024-01-17 10:10:17 +00:00
Lewis Russell
5a16d08a63 test: remove unused functions
Removed:
  - `helpers.fixtbl()`
  - `helpers.fixtbl_rec()`
  - `helpers.updated()`
  - `helpers.hasenv()`
  - `helpers.is_arch()`
  - `helpers.isfile()`
2024-01-17 10:10:17 +00:00
Lewis Russell
96ad7e0a4a test: refactor Paths 2024-01-17 10:10:17 +00:00
Lewis Russell
b990a1f286 test: remove test.deprecated 2024-01-17 10:10:17 +00:00
Lewis Russell
b536e0ba37 test: big cleanup followup
Followup to 07a7c0ec
2024-01-17 10:10:17 +00:00
dundargoc
b3e5587b7f
docs: various fixes (#26929)
Co-authored-by: Patrick Bollinger <owner@pjbollinger.com>
Co-authored-by: vilo1839 <139687192+vilo1839@users.noreply.github.com>
2024-01-17 14:01:39 +08:00
zeertzjq
2fce95ec43
vim-patch:9.1.0033: Insert mode not stopped if closing prompt buffer modifies hidden buffer (#27051)
Problem:  Insert mode not stopped if an autocommand modifies a hidden
          buffer while closing a prompt buffer.
Solution: Don't set b_prompt_insert if stop_insert_mode is already set.
          (zeertzjq)

closes: vim/vim#13872

96958366ad
2024-01-17 08:18:52 +08:00
altermo
da541c0af1
vim-patch:9.1.0035: i_CTRL-] triggers InsertCharPre (#27049)
* vim-patch:9.1.0035: i_CTRL-] triggers InsertCharPre

Problem:  i_CTRL-] triggers InsertCharPre
Solution: Return if CTRL-] is received. InsertCharPre
          is supposed to be only used for chars to be inserted
          but i_CTRL-] triggers expansion and is not inserted
          into the buffer (altermo)

closes: vim/vim#13853
closes: vim/vim#13864

7d711fe209
2024-01-17 07:35:32 +08:00
Sean Dewar
aa5819f5a5
vim-patch:211211052d04 (#27048)
runtime(odin): include ftplugin, syntax and indent script (vim/vim#13867)

211211052d

Translate the files from Vim9 script to legacy Vim script. Notably:

- Prefer case-matching comparisons where needed.
- Save and restore `&cpo`.
- Make the functions script-local. (Pretty easy to use these in expr options now
  since Vim 9.0 anyways)

Add a note after the header for each file stating that they're manually
translated.

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-01-16 23:08:41 +00:00
Jongwook Choi
3973a5e405 refactor(lsp): deprecate vim.lsp.util.lookup_section
This function is used only in the `workspace/configuration` handler,
and does not warrant a public API because of its confusing return types.

The only caller `vim.lsp.handlers["workspace.configuration"]` is also
refactored to use `vim.tbl_get()` instead.
2024-01-16 20:14:17 +00:00
Lewis Russell
8f02ae82e2 test: use integers for API Buffer/Window/Tabpage EXT types 2024-01-16 19:11:49 +00:00
Sean Dewar
91dc04a5e1
vim-patch:9.1.0013: Modula2 filetype support lacking (#27020)
Problem:  Modula2 filetype support lacking
Solution: Improve the Modula-2 runtime support, add additional modula2
          dialects, add compiler plugin, update syntax highlighting,
          include syntax tests, update Makefiles (Doug Kearns)

closes: vim/vim#6796
closes: vim/vim#8115

68a8947069

- Luaify the detection script:

  - Split the `(*!m2foo*)` and `(*!m2foo+bar*)` detection into two Lua patterns,
    as Lua capture groups cannot be used with `?` and friends (as they only work
    on character classes).

  - Use `vim.api.nvim_buf_call()` (ew) to call `modula2#SetDialect()` to ensure
    `b:modula2` is set for the given bufnr.

- Skip the syntax screendump tests. (A shame as they test some of the detection
  from `(*!m2foo+bar*)` tags, but I tested this locally and it seems to work)

- Port the synmenu.vim changes from Vim9 script. (Also tested this locally)

- (And also add the missing comma for `b:browsefilter` from earlier.)

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-01-16 17:45:57 +00:00
bfredl
fd2ed024c1
Merge pull request #26938 from luukvbaal/relnum
fix(column): redraw 'statuscolumn' on wrapped lines with 'relativenumber'
2024-01-16 13:08:47 +01:00
Luuk van Baal
463cb28a22 docs(column): 'statuscolumn' redraw interaction with 'relativenumber' 2024-01-16 12:14:00 +01:00
Luuk van Baal
c6864b0d14 fix(column): redraw 'statuscolumn' on wrapped lines with 'relativenumber'
Problem:  The 'statuscolumn' is not redrawn on the wrapped part of a
          line when moving the cursor with 'relativenumber' set.
Solution: Redraw the 'statuscolumn' for the entire line height in the
          "col_rows" win_line() code path.
2024-01-16 12:13:36 +01:00
Lewis Russell
50284d07b6 fix(diagnostic): typing 2024-01-16 09:33:10 +00:00
Christian Clason
91ba9d0bf4 build(deps): bump tree-sitter to HEAD - 660481dbf 2024-01-16 09:58:02 +01:00
Christian Clason
3fef24aa01 vim-patch:ef79c5783782
runtime(fortran): update fortran syntax (vim/vim#13870)

Support most remaining features of Fortran 2018/2023
Small improvements to folding etc,
Code cleanup: use \? instead of mix of \= and \?

ef79c57837

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2024-01-16 09:18:02 +01:00
Jongwook Choi
6a4c4fa198 ci: stale bot should close the issue with "not planned"
Problem: When the stable bot automatically closes an issue, the issue
will be marked as "closed as completed". It'd be better to mark the
as "closed as not planned".

Solution: Use `state_reason: "not_planned"` from the issues REST API.

References (REST API):
https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#update-an-issue
2024-01-16 08:59:43 +01:00
github-actions[bot]
70d47a1776
version.c: update (#27036)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2024-01-16 14:33:10 +08:00
zeertzjq
92672a161c
docs(builtin): remove signatures of undocumented functions (#27039)
Having an empty signature causes an empty line in generated docs,  so
remove it.

Also change ">" to ">vim" in foreach() docs.
2024-01-16 12:07:35 +08:00
zeertzjq
46a7c1b319
vim-patch:partial:9.1.0027: Vim is missing a foreach() func (#27037)
Problem:  Vim is missing a foreach() func
Solution: Implement foreach({expr1}, {expr2}) function,
          which applies {expr2} for each item in {expr1}
          without changing it (Ernie Rael)

closes: vim/vim#12166

e79e207760

Partial port as this doesn't handle non-materialized range() lists.

vim-patch:c92b8bed1fa6

runtime(help): delete duplicate help tag E741 (vim/vim#13861)

c92b8bed1f

Co-authored-by: Ernie Rael <errael@raelity.com>
2024-01-16 11:30:35 +08:00
zeertzjq
267e90f31d
fix(edit): don't go to Terminal mode when stopping Insert mode (#27033) 2024-01-16 10:42:09 +08:00
zeertzjq
a34451982f
vim-patch:8.1.1968: crash when using nested map() (#27029)
Problem:    Crash when using nested map().
Solution:   Clear the pointer in prepare_vimvar(). (Ozaki Kiichi,
            closes vim/vim#4890, closes vim/vim#4891)

27da7de7c5

Cherry-pick Test_filter_map_nested() from patch 8.1.1964.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-01-16 09:32:57 +08:00
zeertzjq
73e1942abe
vim-patch:9.1.0009: Cannot easily get the list of matches (#27028)
Problem:  Cannot easily get the list of matches
Solution: Add the matchstrlist() and matchbufline() Vim script
          functions (Yegappan Lakshmanan)

closes: vim/vim#13766

Omit CHECK_LIST_MATERIALIZE(): it populates a List with numbers only,
and there is a check for strings below.

f93b1c881a

vim-patch:eb3475df0d92

runtime(doc): Replace non-breaking space with normal space (vim/vim#13868)

eb3475df0d

Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
2024-01-16 08:00:08 +08:00
Gregory Anders
ae48d965d7
fix(coverity/477623,477624): guard null pointer dereference in kv_concat_len (#27022)
Coverity warns about a possible null pointer dereference in the `memcpy`
call in `kv_concat_len`. The `memcpy` follows `kv_ensure_space` which
(re)allocates the `items` pointer if the vector's capacity is not large
enough to contain all of the items being appended. The only way `items`
would be NULL at this point is if `capacity` were mistakenly set to some
large number without `items` ever having being set in the first place.
This should not happen when using the kvec API so if this condition is
ever false it is a bug, which the `assert` will catch.
2024-01-15 14:25:57 -06:00
Daniel Steinberg
7589336120
feat(terminal): respond to OSC background and foreground request (#17197)
The motivation for this update is Issue #15365, where background=light
is not properly set for Nvim running from an Nvim :terminal. This can be
encountered when e.g., opening a terminal to make git commits, which
opens EDITOR=nvim in the nested terminal.

Under the implementation of this commit, the OSC response always
indicates a black or white foreground/background. While this may not
reflect the actual foreground/background color, it permits 'background'
to be retained for a nested Nvim instance running in the terminal
emulator. The behaviour matches Vim.
2024-01-15 10:12:07 -06:00
zeertzjq
9c202b9392
fix(grid): handle clearing half a double-width char (#27023) 2024-01-15 23:45:11 +08:00