Commit Graph

29402 Commits

Author SHA1 Message Date
Luuk van Baal e21423bb35 vim-patch:9.1.0260: Problems with "zb" and scrolling to new topline with 'smoothscroll'
Problem: "zb" does not reveal filler lines at the start of a buffer.
          Scrolled cursor position with 'smoothscroll' is unpredictable,
          and may reset skipcol later if it is not visible (after v9.1.258)
Solution: Replace confusing for loop that reaches final control value too
          early with while loop. Set "w_curswant" accordingly so cursor
          will be placed in visible part of topline.
          (Luuk van Baal)

bd28cae1f1
2024-04-08 23:15:43 +02:00
Luuk van Baal e6cfa22c4c vim-patch:9.1.0258: half-page scrolling broke backward compatibility
Problem:  Support for 'smoothscroll' in (half-)page scrolling
          broke backward compatibility and can be made to work better.
          (after v9.1.215)
Solution: Restore the previous cursor and end-of-buffer behavior for
          half-page scrolling and improve 'smoothscroll' support.
          (Luuk van Baal)

cb204e688e
2024-04-08 23:15:43 +02:00
dundargoc 7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
zeertzjq 978962f9a0
build(release.sh): regenerate docs after changing NVIM_API_PRERELEASE (#28229)
After #25574, the value of NVIM_API_PRERELEASE can affect docs, so docs
need to be regenerated after changing NVIM_API_PRERELEASE.
2024-04-08 17:46:41 +08:00
dundargoc 624de849de build: add function add_target
It's a combination of add_custom_target and add_custom_command that does
what most users probably expect should happen.

This also fixes `make clean` removing files tracked by git.
2024-04-08 10:52:53 +02:00
zeertzjq be2a4b52b9
docs(BUILD): mention treesitter parser dependencies (#28226)
Also add missing mention of libvterm and remove mention of libtermkey.
2024-04-08 16:04:54 +08:00
Christian Clason 541c2d3816 vim-patch:9.1.0273: filetype: keymap files are not recognized
Problem:  filetype: keymap files are not recognized
Solution: Detect '*.keymap' files as Device Tree Files
          (0xadk)

closes: vim/vim#14434

b78753db5f

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2024-04-08 00:35:38 +02:00
zeertzjq d188b929d4
vim-patch:9.1.0272: autocmd may change cwd after :tcd and :lcd (#28223)
Problem:  Autocommand may change currect directory after :tcd and :lcd.
Solution: Also clear tp_localdir and w_localdir when using aucmd_win.
          (zeertzjq)

closes: vim/vim#14435

9d956ee8ea
2024-04-08 06:25:22 +08:00
zeertzjq d32cbef595
vim-patch:9cd9e759ab1e (#28224)
runtime(doc): Normalise builtin-function optional parameter formatting

These should generally be formatted as func([{arg}]) and referenced as
{arg} in the description.

closes: vim/vim#14438

9cd9e759ab

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-08 06:11:31 +08:00
bfredl 067f51e3aa
Merge pull request #28183 from bfredl/intechnicolor
refactor(tests): use more standard colors but with extra colors
2024-04-07 11:49:13 +02:00
Barrett Ruth f6dcc464f2
fix(health): check unmatching python_glob as empty table (#28215) 2024-04-07 11:50:45 +08:00
zeertzjq 98d687a4e1
test: more tests for aucmd_win remaining floating (#28214) 2024-04-07 07:10:32 +08:00
dundargoc 9dd112dd48 refactor: remove fn_bool
It's better to use vim.fn directly instead of creating minor
abstractions like fn_bool.
2024-04-06 16:42:26 +02:00
zeertzjq 7560aee595
vim-patch:9.1.0266: filetype: earthfile files are not recognized (#28207)
Problem:  filetype: earthfile files are not recognized
Solution: Detect 'Earthfile' as earthfile
          (Gaëtan Lehmann)

closes: vim/vim#14408

28e5e7c484

Co-authored-by: Gaëtan Lehmann <gaetan.lehmann@gmail.com>
2024-04-06 21:11:57 +08:00
dundargoc 0443f06b71 docs: don't mention executable() can return -1
This cannot happen for neovim.
2024-04-06 12:47:28 +02:00
zeertzjq 703f97568d
docs: tags for commenting mappings without "-default" suffix (#28205)
This actually won't cause "duplicate tag" errors if plugins have tags of
the same name, because E154 is only given for duplicate tags in the same
directory.

Without those tags, trying to use :h for these mappings jumps to other
places, because there are matches with higher score.
2024-04-06 18:40:38 +08:00
zeertzjq 406ff52824
test: fix vimscript/server_spec leaving behind a dir (#28204) 2024-04-06 15:19:13 +08:00
zeertzjq f4df49a959
revert: "vim-patch:9.1.0055: formatting long lines is slow"
Revert "vim-patch:9.1.0055: formatting long lines is slow (#27199)"

This reverts commit 89a9745a1a.

Fix #28197
2024-04-06 12:04:24 +08:00
zeertzjq ae28ef327e
fix: adjust error message for error in UI event callback (#28200)
Also close Nvim instance before removing log file, otherwise the Nvim
instance will still write to the log file.

Also adjust log level in libuv_process_spawn(). Ref #27660
2024-04-06 11:18:43 +08:00
github-actions[bot] ddbd2b4e40
version.c: update [skip ci] (#28201)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2024-04-06 11:15:08 +08:00
Yinzuo Jiang fe0f1f1c19
vim-patch:cec44eae82c1 (#28199)
runtime: Remove more fallback :CompilerSet definitions from compiler plugins

Continue with vim/vim#14399

vim/vim@cec44ea
2024-04-06 11:13:56 +08:00
luukvbaal 97122eaa1c
fix(column): ignore empty signcols range (#28177)
Problem:  Invalid assert for empty signcols range. The empty range
          should already be removed from "b_signcols" at this point.
          The "clear" == kTrue call before the splice that made the
          range empty will have removed it, and the "clear" == kNone
          call after the splice already ignores the empty range.
Solution: Return early when "row2" < "row1".
2024-04-06 09:32:07 +08:00
zeertzjq 5581a90e20
test: reduce sleep for file timestamp change (#28196)
Now that Nvim always supports nanotime, sleeping for some milliseconds
is enough.
2024-04-06 08:59:50 +08:00
zeertzjq 08ae0c840b
test(old): sleep for 1 second on non-Windows in test_stat.vim (#28195)
Now that Nvim always supports nanotime, sleeping for some milliseconds
is actually enough, but for test_stat.vim keeping some longer sleeps may
increase test coverage, so just match the upstream test.
2024-04-06 08:33:07 +08:00
zeertzjq a4e4e493df
Merge pull request #28194 from zeertzjq/vim-9.1.0267
vim-patch:9.1.{0267,0268,0269}
2024-04-06 06:18:50 +08:00
zeertzjq c7d12a5e01 vim-patch:9.1.0269: Test for TextChanged is still flaky with ASAN
Problem:  Test for TextChanged is still flaky with ASAN.
Solution: Don't index the result of readfile().
          (zeertzjq)

It turns out that with ASAN the file may become empty during a write
even if it's non-empty both before and after the write, in which case
indexing the result of readfile() will error, so use join() instead.

Also don't delete the file halfway the test, just in case it may cause
errors on the next read.

closes: vim/vim#14421

e9ff79a7c9
2024-04-06 05:59:13 +08:00
zeertzjq f4a0c853db vim-patch:9.1.0268: Two tests in test_filechanged.vim are slow
Problem:  Two tests in test_filechanged.vim are slow.
Solution: Sleep for shorter if the +nanotime feature is available.
          (zeertzjq)

closes: vim/vim#14418

83cd2c7bf0
2024-04-06 05:58:55 +08:00
zeertzjq dcf4c5744a vim-patch:9.1.0267: File name entered in GUI dialog is ignored
Problem:  File name entered in GUI dialog is ignored (after v9.1.0265)
Solution: Only set file name to "Untitled" if GUI dialog didn't set it.
          (zeertzjq)

closes: vim/vim#14417

c20bdf1107
2024-04-06 05:58:21 +08:00
zeertzjq 66568ed452
vim-patch:b73faa1c02d0 (#28193)
runtime: fix :compiler leaving behind a g:makeprg variable (vim/vim#14414)

Problem:  :compiler may leave behind a g:makeprg variable after vim/vim#14336.
Solution: Use a script local variable.

b73faa1c02

Also apply previously omitted change to compiler/context.vim.
2024-04-06 05:44:37 +08:00
Christian Clason 7098341387 build(deps): bump msgpack-c to v6.0.1 2024-04-05 18:49:42 +02:00
Christian Clason 39a0e6bf3c fix(treesitter): update parsers and queries 2024-04-05 18:36:17 +02:00
Evgeni Chasnovski 73de98256c feat(comment): add built-in commenting
Design

- Enable commenting support only through `gc` mappings for simplicity.
  No ability to configure, no Lua module, no user commands. Yet.

- Overall implementation is a simplified version of 'mini.comment'
  module of 'echasnovski/mini.nvim' adapted to be a better suit for
  core. It basically means reducing code paths which use only specific
  fixed set of plugin config.

  All used options are default except `pad_comment_parts = false`. This
  means that 'commentstring' option is used as is without forcing single
  space inner padding.

As 'tpope/vim-commentary' was considered for inclusion earlier, here is
a quick summary of how this commit differs from it:

- **User-facing features**. Both implement similar user-facing mappings.
  This commit does not include `gcu` which is essentially a `gcgc`.
  There are no commands, events, or configuration in this commit.

- **Size**. Both have reasonably comparable number of lines of code,
  while this commit has more comments in tricky areas.

- **Maintainability**. This commit has (purely subjectively) better
  readability, tests, and Lua types.

- **Configurability**. This commit has no user configuration, while
  'vim-commentary' has some (partially as a counter-measure to possibly
  modifying 'commentstring' option).

- **Extra features**:
    - This commit supports tree-sitter by computing `'commentstring'`
      option under cursor, which can matter in presence of tree-sitter
      injected languages.

    - This commit comments blank lines while 'tpope/vim-commentary' does
      not. At the same time, blank lines are not taken into account when
      deciding the toggle action.

    - This commit has much better speed on larger chunks of lines (like
      above 1000). This is thanks to using `nvim_buf_set_lines()` to set
      all new lines at once, and not with `vim.fn.setline()`.
2024-04-05 18:07:43 +02:00
Christian Clason 2b9d8dc87e vim-patch:408281e16a36
runtime: Remove fallback :CompilerSet definition from compiler plugins

The :CompilerSet command was added in version Vim 6.4 which was released
twenty years ago.  Other runtime files do not support versions of that
vintage so it is reasonable to remove this fallback command definition
now.

closes: vim/vim#14399

408281e16a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-05 15:45:13 +02:00
Mathias Fußenegger 9af3559643
feat(lsp): set workDoneToken in initialize request (#28182)
Problem:

Some servers don't report progress during initialize unless the client
sets the `workDoneToken`

See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initiatingWorkDoneProgress

In particular:

> There is no specific client capability signaling whether a client will
> send a progress token per request. The reason for this is that this is
> in many clients not a static aspect and might even change for every
> request instance for the same request type. So the capability is signal
> on every request instance by the presence of a workDoneToken property.

And:

> Servers can also initiate progress reporting using the
> window/workDoneProgress/create request. This is useful if the server
> needs to report progress outside of a request (for example the server
> needs to re-index a database). The token can then be used to report
> progress using the same notifications used as for client initiated
> progress.

So far progress report functionality was relying entirely on the latter.

Solution:

Set a `workDoneToken`

Closes https://github.com/neovim/neovim/issues/27938
2024-04-05 13:24:39 +02:00
zeertzjq 6ecb5d2d0c
vim-patch:9.1.0265: console dialog cannot save unnamed buffers (#28185)
Problem:  console dialog cannot save unnamed buffers
Solution: set bufname before save (glepnir). Define dialog_con_gui
          to test for GUI+Console dialog support, use it to skip
          the test when the GUI feature has been defined.

Note: The dialog_changed() function will also try to call the
browse_save_fname() function, when FEAT_BROWSE is defined (which is only
defined in a GUI build of Vim). This will eventually lead to a call of
do_browse(), which causes an error message if a GUI is not currently
running (see the TODO: in do_browse()) and will then lead to a failure
in Test_goto_buf_with_onfirm().

Therefore, we must disable the Test_goto_buf_with_onfirm(), when the
dialog_con_gui feature is enabled (which basically means dialog feature
for GUI and Console builds, in contrast to the dialog_con and dialog_gui
feature).

(Previously this wasn't a problem, because the test aborted in the YES
case for the :confirm :b XgotoConf case and did therefore not run into
the browse function call)

closes: vim/vim#14398

df46115fc8

Co-authored-by: glepnir <glephunter@gmail.com>
2024-04-05 18:32:04 +08:00
zeertzjq 9711370c26
feat(defaults): add :Inspect to right-click menu (#28181)
Ref #21393

- Move default user commands to _defaults.lua as that now contains all
  kinds of defaults rather than just default mappings and menus.
- Remove the :aunmenu as there are no menus when _defaults.lua is run.
2024-04-05 18:08:54 +08:00
zeertzjq a500c5f808
vim-patch:8.1.0815: dialog for file changed outside of Vim not tested (#28184)
Problem:    Dialog for file changed outside of Vim not tested.
Solution:   Add a test.  Move FileChangedShell test.  Add 'L' flag to
            feedkeys().

5e66b42aae

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-05 18:04:45 +08:00
bfredl e920d0f941 refactor(tests): use more standard colors but with extra colors 2024-04-05 11:00:10 +02:00
Christian Clason 4add77ddbf vim-patch:5ccdcc482e29
runtime(java): Improve the matching of contextual keywords

- Recognise a _record_ contextual keyword.
- Recognise _non-sealed_, _sealed_, and _permits_ contextual
  keywords.
- Admit _$_ to keyword characters.
- Group _abstract_, _final_, _default_, _(non-)sealed_
  (apart from _(non-)sealed_, the incompossibility of these
  modifiers calls for attention).
- Remove another _synchronized_ keyword redefinition.

I have also replaced a function with an expression.  Before
patch 8.1.0515, it should have been declared :function! to
work with repeatable script sourcing; there is less to worry
about with an expression.

References:
https://openjdk.org/jeps/395 (Records)
https://openjdk.org/jeps/409 (Sealed Classes)
https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.8

closes: vim/vim#14403

5ccdcc482e

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-04-05 09:07:07 +02:00
Famiu Haque 75b80516d5
build: fix link error for `_BitScanForward64` (#28173)
Problem: The usage of `_BitScanForward64` causes linking to fail on some systems.
Solution: Correctly check if it exists using `check_c_source_compiles`.
2024-04-05 09:56:35 +08:00
zeertzjq dc69c475a5
vim-patch:9.1.0262: Test for TextChanged is flaky with ASAN (#28180)
Problem:  Test for TextChanged is flaky with ASAN.
Solution: Wait for the file to be non-empty.
          (zeertzjq)

closes: vim/vim#14404

4a65391ca2
2024-04-05 07:24:25 +08:00
dundargoc e016f5bee6 test: reduce `exec_lua` calls
`exec_lua` makes code slighly harder to read, so it's beneficial to
remove it in cases where it's possible or convenient.

Not all `exec_lua` calls should be removed even if the test passes as it
changes the semantics of the test even if it happens to pass.

From https://github.com/neovim/neovim/pull/28155#discussion_r1548185779:

"Note for tests like this, which fundamentally are about conversion, you
end up changing what conversion you are testing. Even if the result
happens to be same (as they often are, as we like the rules to be
consistent if possible), you are now testing the RPC conversion rules
instead of the vim script to in-process lua conversion rules."

From https://github.com/neovim/neovim/pull/28155#discussion_r1548190152:

"A test like this specifies that the cursor is valid immediately and not
after a separate cycle of normal (or an other input-processing) mode."
2024-04-04 13:10:11 +02:00
Christian Clason 56701cd21e vim-patch:08d2401fbc6d
runtime(netrw): filetype not detected when editing remote files

fixes: vim/vim#14400

08d2401fbc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-04 10:29:58 +02:00
zeertzjq 15a2dd9e96
vim-patch:89cc03af71d9 (#28168)
runtime(doc): sort filetype.txt in the alphabetical order (vim/vim#14395)

89cc03af71

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-04-04 06:19:13 +08:00
zeertzjq a469745338
vim-patch:9.1.0259: Normal mode TextChanged isn't tested properly (#28167)
Problem:  Normal mode TextChanged isn't tested properly.
Solution: Combine Test_Changed_ChangedI() and Test_Changed_ChangedI_2()
          and also run it on Windows. Fix a typo in main.c.
          (zeertzjq)

closes: vim/vim#14396

c422662933
2024-04-04 06:11:17 +08:00
bfredl 1b55ed58ec
Merge pull request #28156 from bfredl/attr_extend
refactor(tests): allow to extend the new base set of attrs
2024-04-03 13:39:08 +02:00
Raphael dbc0fa9bd6
fix(stdpath): remove duplicate directories (#26653) 2024-04-03 18:44:57 +08:00
bfredl ab0d3c4098
Merge pull request #28157 from fredizzimo/fsundvik/fix-io
fix: prevent child processes from inheriting ui channel file descriptors
2024-04-03 12:35:57 +02:00
Christian Clason e74cd1d9ff vim-patch:9.1.0253: filetype: typespec files are not recognized
Problem:  filetype: typespec files are not recognized
Solution: Detect '*.tsp' files as typespec
          (Hilmar Wiegand)

Specs is at https://typespec.io/

closes: vim/vim#14392

6c9f4f98f1

Co-authored-by: Hilmar Wiegand <me@hwgnd.de>
2024-04-03 10:45:29 +02:00
zeertzjq 99b3a068de
vim-patch:8.2.4098: typing "interrupt" at debug prompt may keep exception around (#28161)
Problem:    Typing "interrupt" at debug prompt may keep exception around,
            causing function calls to fail.
Solution:   Discard any exception at the toplevel. (closes vim/vim#9532)

069613c9e8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-03 10:43:03 +08:00