Commit Graph
816 Commits
Author SHA1 Message Date
zeertzjqandAaron Jacobs 59a44caac6 vim-patch:eba5133: runtime(rust): Do not use rustfmt as 'formatprg' by default (#36361)
This reverts commit 4ac995bf9366c6624a0724d19b2226f4c95694b3.

This was added in vim/vim#16807, with no explanation for why it was necessary beyond
"it's an example of an idea". It completely breaks `gq` for me—rustfmt doesn't
reflow comments so is not an appropriate tool here! Beyond that, formatting a
selection with rustfmt treats that selection as if it were an entire file,
throwing away any indentation.

For example, the commit causes `gq` to turn this:

```rust
pub fn foo() {
    // blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
}
```

into this:

```rust
pub fn foo() {
// blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
}

```

which is totally wrong. In contrast, if I clear `formatprg` then `gq` does the
right thing again:

```rust
pub fn foo() {
    // blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    // blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    // blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    // blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    // blah blah blah blah blah blah
}
```

related: vim/vim#16967
related: vim/vim#17055
closes: vim/vim#18640

https://github.com/vim/vim/commit/eba51337d4b8051b768164f3394d680742234ca8

Co-authored-by: Aaron Jacobs <jacobsa@google.com>
2025-10-27 23:45:14 +00:00
zeertzjqandPhạm Bình An fb6fd17f26 vim-patch:9.1.1870: :Tutor may not work as expected (#36343)
Problem:  :Tutor may not work as expected
Solution: set buftype=nowrite instead of nofile
          (Phạm Bình An)

closes: vim/vim#18613

https://github.com/vim/vim/commit/9978bb77c68c2afa056b7c1ec0fa9d9648cb1960

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-10-27 01:21:52 +00:00
Tom Ampuero 7c5ff99e8a refactor(spell): migrate to Lua, drop netrw dependency
Problem:
Spell file downloads relied on Vimscript and netrw (:Nread). If netrw is
disabled, downloads fail.

Solution:
Port the logic to Lua as `nvim.spellfile` and wire it via a Lua plugin that
handles `SpellFileMissing`. Use `vim.net.request()` with a timeout for HTTP,
prompt via `vim.fn.input` and report via `vim.notify`.

Closes #7189
2025-10-26 00:33:41 +02:00
zeertzjqandShay 7837161076 vim-patch:70d745a: runtime(zip): support PowerShell Core (#35880)
fixes: vim/vim#17987
closes: vim/vim#18345

https://github.com/vim/vim/commit/70d745a61bc12d94b9b217887004c1a5c263cb9d

Co-authored-by: Shay <shay_public@hotmail.com>
2025-09-22 23:21:27 +00:00
zeertzjqandLuca Saccarola c7a9404019 vim-patch:becf184: runtime(misc): removing saccarosium from maintainer list (#35740)
closes: vim/vim#17848

https://github.com/vim/vim/commit/becf1844e03462b2c997689caafc77bc9c812252

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2025-09-13 01:18:18 +00:00
zeertzjqandMaxim Kim e23794b090 vim-patch:3add0d5: runtime(ccomplete): use complete_check() in ccomplete plugin (#35142)
Add complete_check() to ccomplete completion script to avoid UI hangs
and keep Vim responsive as ccomplete can be slow on huge files.

closes: vim/vim#17826

https://github.com/vim/vim/commit/3add0d5e75f82e34c3740ef697620cd330507ae5

vim-patch:44309b9: runtime(ccomplete): return partial results on complete_check()

closes: vim/vim#17838

https://github.com/vim/vim/commit/44309b9d08ba657d8c2ee5ed614c14b0fa0cfefc

Co-authored-by: Maxim Kim <habamax@gmail.com>
2025-08-03 11:49:13 +08:00
Christian ClasonandChristian Brabandt 14cafbcc85 vim-patch:1afe8c3: runtime(rust): improve loading time
fixes: vim/vim#17745
closes: vim/vim#17749

https://github.com/vim/vim/commit/1afe8c3a4d9d61a4762c11ddf4c50050a92bd23e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-20 13:27:55 +02:00
Justin M. Keyes fd5d04fbff Merge #34921 tutor: reimplement interactive marks as extmarks 2025-07-17 23:26:55 -04:00
brianhusterandJustin M. Keyes 1255a8d88d refactor(tutor): reimplement interactive marks as extmark in Lua
Problem:
From https://matrix.to/#/!cylwlNXSwagQmZSkzs:matrix.org/$Ofj-TFIsEMbp0O9OhE8xuZSNi-nhRLtZTOgs6JRLNrs?via=matrix.org&via=gitter.im&via=mozilla.org

In lesson 2.6, users are asked to remove the second, forth and fifth
lines with `dd` command, then they are asked to undo twice to make the
text go back to original state. But after that, the mark ✗ appears
again, which confuses the user because they think they do something
wrong. This is a limitation with the current implementation, which is
based on line number only.

Solution:
Reimplement interactive marks as extmarks in Lua. This also make the
feature less fragile, as users can remove, add some arbitrary lines
without breaking the interactive marks.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-07-18 10:04:20 +07:00
zeertzjqandChristian Brabandt 77c6cae25b vim-patch:9.1.1552: [security]: path traversal issue in tar.vim
Problem:  [security]: path traversal issue in tar.vim
          (@ax)
Solution: warn the user for such things, drop leading /, don't
          forcefully overwrite files when writing temporary files,
          refactor autoload/tar.vim

tar.vim: drop leading / in path names

A tar archive containing files with leading `/` may cause confusions as
to where the content is extracted.  Let's make sure we drop the leading
`/` and use a relative path instead.

Also while at it, had to refactor it quite a bit and increase the
minimum supported Vim version to v9. Also add a test for some basic tar
functionality

closes: vim/vim#17733

https://github.com/vim/vim/commit/87757c6b0a4b2c1f71c72ea8e1438b8fb116b239

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-18 08:40:23 +08:00
zeertzjqandChristian Brabandt ad0c21a445 vim-patch:470317f: runtime(tar): remove dependency on netrw#WinPath, include mapping doc
related: vim/vim#17124

https://github.com/vim/vim/commit/470317f78b110b4559cecb26039b5f93447c1bf0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-18 08:40:23 +08:00
2efc84d005 vim-patch:a250738: runtime(tar): use readblob() instead of shelling out to file(1)
fixes: #vim/vim#16761
closes: vim/vim#16769

https://github.com/vim/vim/commit/a250738303f85132335d69fd1936501b189eebce

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
2025-07-18 08:40:23 +08:00
zeertzjqandChristian Brabandt 5cfdd4d8b9 vim-patch:9.1.1551: [security]: path traversal issue in zip.vim (#34951)
Problem:  [security]: path traversal issue in zip.vim (@ax)
Solution: drop leading ../ on write of zipfiles, don't forcefully
          overwrite existing files

A zip plugin which contains filenames with leading '../'  may cause
confusion as to where the content will be extracted.  Let's drop such
things and make sure we use a relative filename instead and don't
forcefully overwrite temporary files. Also, warn the user of such
things.

related: vim/vim#17733

https://github.com/vim/vim/commit/586294a04179d855c3d1d4ee5ea83931963680b8

vim-patch:e1044fb: runtime(zip): raise minimum Vim version to v9.0
vim-patch:e2d9b0d: runtime(zip): zip plugin does not work with Vim 9.0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-16 01:08:57 +00:00
Phạm Bình An bff7d3fd9f fix(tutor): cannot find tutors in pack/*/start/* #34689
Problems:
- Unlike in Vim, Neovim does not report pack/*/start/* in the resolved value of 'rtp' (see `:help packages-runtimepath`)
- This means that the tutor plugin cannot find the tutors in pack/*/start/*

Solution:
- Use nvim_list_runtime_paths() instead of &rtp
2025-06-28 09:40:24 -07:00
Antoine ac12dc49cc fix(clipboard): enable cache for function providers #34470
Problem:
With these settings, copy/pasting `blockwise-visual` (with `CTRL+V`)
incorrectly pastes as a `linewise` mode because `regtype` is ignored:

    vim.opt.clipboard = 'unnamedplus'
    vim.g.clipboard = 'osc52'

To reproduce: press `CTRL+V` and select some characters press `p` and
observe that it is pasted in `linewise` mode.

Solution:
Enable the [clipboard.vim](https://github.com/neovim/neovim/blob/master/runtime/autoload/provider/clipboard.vim#L281-L283))
cache for function providers, so that `regtype` is maintained for the OSC52
clipboard provider.
2025-06-12 09:18:23 -07:00
Christian ClasonandGregory Anders aa9fd08034 vim-patch:c8b7e61: runtime: Add license information for HCL and Terraform runtime files
fixes: vim/vim#17372
closes: vim/vim#17377

https://github.com/vim/vim/commit/c8b7e6129a057fbcbff0d9e73dd8a476fd97a813

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-05-26 17:51:24 +02:00
brianhusterandPhạm Bình An f791ae82e5 vim-patch:9.1.1404: wrong link to Chapter 2 in new-tutor
Problem:  wrong link to Chapter 2 in vim-01-beginner.tutor
Solution: Fix the link to Chapter 2, add test for links in tutor files
          (Phạm Bình An)

In order to write the test, I exposed the function `s:GlobTutorials` as
`tutor#GlobTutorials` and make it also accept a `locale` argument.

closes: vim/vim#17356

https://github.com/vim/vim/commit/e8302da74aee55fe8f6496b5b711fed7d92318c5

Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
2025-05-23 09:59:43 +07:00
Christian ClasonandMichele Sorcinelli 849e24f3cd vim-patch:719ec0f: runtime(tar): preserve pwd when reading and writing tar files
While at it, use `:lcd` to temporarily set the window local directory
instead of `:cd` for the global working directory.

fixes: vim/vim#17334
closes: vim/vim#17339

https://github.com/vim/vim/commit/719ec0fe154e321bf7cf2cb2f93e8aa30036b87e

Co-authored-by: Michele Sorcinelli <michelesr@autistici.org>
2025-05-20 08:15:27 +02:00
Fredrik Foss-IndrehusandFredrik Foss-Indrehus 3a35fdc347 feat(clipboard): wayclip primary clipboard and correct mimetype (#33990)
* Don't specify wayclip mimetype

Problem:  Since wayclip 0.2, wayclip assumes UTF-8
          (text/plain;charset=utf-8) in absence of an explicit mimetype.
	  Since Neovim sets the mimetype to "text/plain" without
	  specifying UTF-8, you will also have to use `-t text/plain`
	  when using waypaste or wayclip outside of Neovim.

Solution: Don't specify mimetype when using wayclip, thereby using the
          default "text/plain:charset=utf-8".

* Add primary clipboard support to wayclip

wayclip have had support for primary clipboard for some time now.

---------

Co-authored-by: Fredrik Foss-Indrehus <fred@ffoss.net>
2025-05-19 07:44:13 +08:00
brianhuster e5665754d1 fix(tutor): l:lang is undefined
Problem:
The scope `elseif $LC_MESSAGES =~ '\a\a' || $LC_MESSAGES ==# "C"` in
function `s:Locale` in file `runtime/autoload/tutor.vim` leaves a case
when l:lang is not defined.

Solution:
Define `l:lang` at function scope instead of `if` scope
2025-05-13 06:54:48 +07:00
brianhuster e01f196e44 vim-patch:9.1.1384: still some problem with the new tutors filetype plugin
Problem:  still some problem with the new tutors filetype plugin
Solution: refactor code to enable/disable tutor mode into
          tutor#EnableInteractive() function, include a test
          (Phạm Bình An)

I find it annoying that Tutor's interactive mode is always on (or debug
mode is off) even when I open a tutor file with :edit command.
I think it makes more sense to make this "interactive mode":

- Always on when it is opened with :Tutor command
- Off otherwise

For more references, see `:help` feature, it is a much better than
:Tutor, since I don't have to run `:let g:help_debug = 1` just to be able
to edit and save a help file

Therefore, I remove `g:tutor_debug`

closes: vim/vim#17299

https://github.com/vim/vim/commit/13bea589a25707c8f9e29b2920410bdcccd79bc5

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-05-13 06:54:32 +07:00
Christian ClasonandAliaksei Budavei a2c3591720 vim-patch:dc7ed8f: runtime(html): Optionally fold tags with the "expr" method
Tag folding poses a few difficulties.  Many elements, e.g.
"blockquote", are always delimited by start and end tags;
end tags for some elements, e.g. "p", can be omitted in
certain contexts; void elements, e.g. "hr", have no end tag.
Although the rules for supporting omissible end tags are
ad-hoc and involved, they apply to elements in scope.
Assuming syntactical wellformedness, an end tag can be
associated with its nearest matching start tag discoverable
in scope and towards the beginning of a file, whereas all
unbalanced tags and inlined tags can be disregarded.

For example:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <p>Paragraph vim/vim#1.		<!--  = : 2 -->
    <p>				<!-- >3 : 3 -->
      Paragraph vim/vim#2.		<!--  = : 3 -->
    </p>			<!-- <3 : 3 -->
    <p>Paragraph vim/vim#3.</p>	<!--  = : 2 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

(HTML comments here, "<!-- ... -->", record two values for
each folded line that are separated by ":", a value obtained
from "&foldexpr" and a value obtained from "foldlevel()".)

Innermost foldedable tags will be flattened.  For example:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre><code>		<!-- >4 : 4 -->
[CODE SNIPPET]			<!--  = : 4 -->
      </code></pre>		<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

No folding will be requested for the "<code>"-"</code>" tag
pair and reflected by "&foldexpr" because such a fold would
have claimed the same lines that the immediate fold of the
"<pre>"-"</pre>" tag already claims.

Run-on folded tags may confuse Vim.  When a file such as:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET vim/vim#1]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
				<!--  = : 3 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET vim/vim#2]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

is reformatted as follows:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET vim/vim#1]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div><div class="block"><pre><code> <!-- <3 : 3 -->
[CODE SNIPPET vim/vim#2]		<!--  = : 2 ? -->
	</code>			<!-- <5 : 2 ? -->
      </pre>			<!-- <4 : 2 ? -->
    </div>			<!-- <3 : 2 ? -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

"&foldexpr" values will not be used as is for the lines
between (and including) "[CODE SNIPPET vim/vim#2]" and "</div>".
(Cf. v9.1.0002.)

Having syntax highlighting in effect, tag folding using the
"fold-expr" method can be enabled with:
------------------------------------------------------------
	let g:html_expr_folding = 1
------------------------------------------------------------

By default, tag folding will be redone from scratch after
each occurrence of a TextChanged or an InsertLeave event.
Such frequency may not be desired, especially for large
files, and this recomputation can be disabled with:
------------------------------------------------------------
	let g:html_expr_folding_without_recomputation = 1
        doautocmd FileType
------------------------------------------------------------

To force another recomputation, do:
------------------------------------------------------------
	unlet! b:foldsmap
	normal zx
------------------------------------------------------------

References:
https://web.archive.org/web/20250328105626/https://html.spec.whatwg.org/multipage/syntax.html#optional-tags
https://en.wikipedia.org/wiki/Dangling_else

closes: vim/vim#17141

https://github.com/vim/vim/commit/dc7ed8f946a3109460435221ad45f92486c4ebca

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-05-11 10:47:39 +02:00
Christian Clason 8c81ed8678 feat(runtime): revert cfilter, ccomplete to legacy Vim
Problem: Transpiled Lua code from vim9script is not amenable to static
analysis, requiring manual cleanup or ignoring parts of our codebase.

Solution: Revert to pre-rewrite version of (low-impact) legacy plugins
and remove the vim9jit shim.
2025-04-22 11:03:05 +02:00
Deveshi Dwivedi 9722bd7b1b feat(clipboard): g:clipboard="foo" forces the "foo" clipboard tool #33235 2025-04-03 06:14:08 -07:00
zeertzjqandKonfekt 2322ae403b vim-patch:4ac995b: runtime(rust): set formatprg to rustfmt (#33245)
closes: vim/vim#16967

https://github.com/vim/vim/commit/4ac995bf9366c6624a0724d19b2226f4c95694b3

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-04-01 17:20:11 +08:00
Sathya Pramodh b4906577c9 fix(provider): misleading :checkhealth if user sets g:loaded_python3_provider=1 #32696
Problem:
:checkhealth shows a confusing message if user sets
g:loaded_python3_provider=1.

Solution:
- Show a warning if that var is set to 1.
- Update provider modules to default to 0. Any user code that is
  checking for 1, is like already broken because these may be set to 2.
2025-03-29 11:06:23 -07:00
Andrei Heidelbacher 563051a53e feat(clipboard): support g:clipboard="osc52" #33021
Problem:
Forcing Neovim to use OSC52 for the system clipboard should be simple
and concise, since OSC52 is widely supported (Alacritty, Ghostty,
iTerm2, WezTerm, Kitty, xterm, tmux, etc.) and is the most portable
approach for syncing clipboards across SSH.

Solution:
Support g:clipboard="osc52".
2025-03-24 05:17:56 -07:00
zeertzjqandChristian Brabandt b25527d20d vim-patch:9.1.1198: [security]: potential data loss with zip.vim (#32867)
Problem:  [security]: potential data loss with zip.vim and special
          crafted zip files (RyotaK)
Solution: use glob '[-]' to protect filenames starting with '-'

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-693p-m996-3rmf

https://github.com/vim/vim/commit/f209dcd3defb95bae21b2740910e6aa7bb940531

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-13 08:47:02 +08:00
zeertzjqandChristian Brabandt 560b8a8ce0 vim-patch:9.1.1164: [security]: code execution with tar.vim and special crafted tar files (#32701)
Problem:  editing a special crafted tar file allows code execution
          (RyotaK, after 129a8446d23cd9cb4445fcfea259cba5e0487d29)
Solution: escape the filename before feeding it to the `:read` command

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-wfmf-8626-q3r3

https://github.com/vim/vim/commit/334a13bff78aa0ad206bc436885f63e3a0bab399

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-02 22:59:54 +00:00
Christian ClasonandChristian Brabandt ea4a7cc616 vim-patch:8ac975d: runtime(tar): fix syntax error in tar.vim
https://github.com/vim/vim/commit/8ac975d97e153205a82ef0177013260f59cc6a2e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-01 23:03:10 +01:00
Christian ClasonandJim Zhou 48e6147e64 vim-patch:56957ed: runtime(misc): add support for bzip3 to tar, vimball and gzip plugins
fixes: vim/vim#16751
closes: vim/vim#16755

https://github.com/vim/vim/commit/56957ed4109fb0c37922c6c37d5926cfe0a3313b

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
2025-03-01 13:21:55 +01:00
dundargoc 198a952c13 build: add luals check
This automatically downloads and uses the correct luals binary for the
currently used system. `make luals` will run luals on all lua files in
`runtime`.

We download lua-language-server manually instead of relying on
contributors downloading it on their own (like with stylua) as
lua-language-server is updated frequently which may cause unnecessary
friction. Therefore, we download a pinned version of luals which we then
can manually bump when needed. This can be re-evaluated if luals becomes
more stable in the future.

Currently this is not run when using `make lint` since cmake style "file
caching" doesn't seem possible at the moment. This is because checking a
single file doesn't seem to work.

Work on https://github.com/neovim/neovim/issues/24563.
2025-02-09 18:10:54 +01:00
zeertzjqandCorpulent Robin 52ff5e3032 vim-patch:b69cd52: runtime(misc): Add support for lz4 to tar & gzip plugin (#32360)
while at it, clean up the tar plugin a bit and sort the patterns for the
tar and gzip plugin

References:
- https://github.com/lz4/lz4
- https://lz4.org/

closes: vim/vim#16591

https://github.com/vim/vim/commit/b69cd52447584cedadc1513aa3acd5b4cd9f4340

Co-authored-by: Corpulent Robin <177767857+corpulentrobin@users.noreply.github.com>
2025-02-07 17:10:51 +08:00
zeertzjqandAliaksei Budavei d7426bc9e9 vim-patch:9.1.0935: SpotBugs compiler can be improved
Problem:  SpotBugs compiler can be improved
Solution: runtime(compiler): Improve defaults and error handling for
          SpotBugs; update test_compiler.vim (Aliaksei Budavei)

runtime(compiler): Improve defaults and error handling for SpotBugs

* Keep "spotbugs#DefaultPreCompilerTestAction()" defined but
  do not assign its Funcref to the "PreCompilerTestAction"
  key of "g:spotbugs_properties": there are no default and
  there can only be introduced arbitrary "*sourceDirPath"
  entries; therefore, this assignment is confusing at best,
  given that the function's implementation delegates to
  whatever "PreCompilerAction" is.

* Allow for the possibility of relative source pathnames
  passed as arguments to Vim for the Javac default actions,
  and the necessity to have them properly reconciled when
  the current working directory is changed.

* Do not expect users to remember or know that new source
  files ‘must be’ ":argadd"'d to be then known to the Javac
  default actions; so collect the names of Java-file buffers
  and Java-file Vim arguments; and let users providing the
  "@sources" file-lists in the "g:javac_makeprg_params"
  variable update these file-lists themselves.

* Strive to not leave behind a fire-once Syntax ":autocmd"
  for a Java buffer whenever an arbitrary pre-compile action
  errors out.

* Only attempt to run a post-compiler action in the absence
  of failures for a pre-compiler action.  Note that warnings
  and failures are treated alike (?!) by the Javac compiler,
  so when previews are tried out with "--enable-preview",
  remember about passing "-Xlint:-preview" too to also let
  SpotBugs have a go.

* Properly group conditional operators when testing for key
  entries in a user-defined variable.

* Also test whether "javaExternal" is defined when choosing
  an implementation for source-file parsing.

* Two commands are provided to toggle actions for buffer-local
  autocommands:
  - SpotBugsRemoveBufferAutocmd;
  - SpotBugsDefineBufferAutocmd.

For example, try this from "~/.vim/after/ftplugin/java.vim":
------------------------------------------------------------
if exists(':SpotBugsDefineBufferAutocmd') == 2
	SpotBugsDefineBufferAutocmd BufWritePost SigUSR1
endif
------------------------------------------------------------

And ":doautocmd java_spotbugs User" can be manually used at will.

closes: vim/vim#16140

https://github.com/vim/vim/commit/368ef5a48c7a41af7fe2c32a5d5659e23aff63d0

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-02-04 06:45:25 +08:00
Christian ClasonandLuca Saccarola e962167245 vim-patch:9cfdabb: runtime(netrw): change netrw maintainer
Dr. Chip retired some time ago and is no longer maintaining the netrw
plugin. However as a runtime plugin distributed by Vim, it important to
maintain the netrw plugin in the future and fix bugs as they are
reported.

So, split out the netrw plugin as an additional package, however include
some stubs to make sure the plugin is still loaded by default and the
documentation is accessible as well.

closes: vim/vim#16368

https://github.com/vim/vim/commit/9cfdabb074feefc9848e9f7a4538f201e28c7f06

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2025-01-18 09:49:35 +01:00
Gregory Anders a389dc2f95 feat(clipboard)!: use OSC 52 as fallback clipboard provider (#31730)
We currently enable the OSC 52 clipboard provider by setting g:clipboard
when a list of conditions are met, one of which is that $SSH_TTY must be
set. We include this condition because often OSC 52 is not the best
clipboard provider, so if there are "local" providers available Nvim
should prefer those over OSC 52.

However, if no other providers are available, Nvim should use OSC 52
even when $SSH_TTY is not set. When a user is in an SSH session then the
checks for the other clipboard providers will still (typically) fail, so
OSC 52 continues to be enabled by default in SSH sessions.

This is marked as a breaking change because there are some cases where
OSC 52 wasn't enabled before and is now (or vice versa).
2024-12-31 09:59:03 -06:00
zeertzjqandshane.xb.qian 725d3e25a3 vim-patch:c673b80: runtime(netrw): more reformating vim/vim#16248 (#31662)
closes: vim/vim#16266

https://github.com/vim/vim/commit/c673b805ad80d0aef07e745d412a2bf298ba1c07

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2024-12-21 01:17:23 +00:00
zeertzjqandLuca Saccarola 39781be14b vim-patch:c363ca1: runtime(netrw): change indent size from 1 to 2 (#31648)
closes: vim/vim#16248

https://github.com/vim/vim/commit/c363ca1ecd1f8db03663ef98dcf41eeacc3c22c7

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-20 11:33:05 +08:00
Christian ClasonandChristian Brabandt 3e3a984300 vim-patch:5c42c77: runtime(netrw): do not pollute search history with symlinks
fixes: vim/vim#16206

https://github.com/vim/vim/commit/5c42c7731536418c53273932d7ef76b80b001f38

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-13 09:38:19 +01:00
Christian ClasonandLuca Saccarola 4182e98752 vim-patch:b66cac1: runtime(typst): add definition lists to formatlistpat, update maintainer
closes: vim/vim#16192

https://github.com/vim/vim/commit/b66cac1a8ed8636a38e867226f5bb621c96ff322

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-10 08:06:35 +01:00
zeertzjqandChristian Brabandt 3d318be8cd vim-patch:92b3666: runtime(netrw): only check first arg of netrw_browsex_viewer for being executable
fixes: vim/vim#16185

https://github.com/vim/vim/commit/92b36663f8d0e507f60f357c6add6f6c9148a951

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-09 08:08:44 +08:00
zeertzjqandKonfekt d7b3add63e vim-patch:eda923e: runtime(netrw): do not detach when launching external programs in gvim
On Debian 12 when detaching the program wouldn't launch at all

closes: vim/vim#16168

https://github.com/vim/vim/commit/eda923e9c9e639bc4f02b8b3ead1e7d27981e552

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-12-09 08:07:06 +08:00
wzy 2495e7e22a fix(clipboard): tmux clipboard depends on $TMUX #31268
Problem:
tmux clipboard not used when tmux is a daemon and $TMUX is empty.

Solution:
If `tmux list-buffers` succeeds, use tmux clipboard.
2024-12-03 05:06:54 -08:00
8d7d225caa vim-patch:65311c6: runtime(compiler): include spotbugs Java linter
closes: vim/vim#16001

https://github.com/vim/vim/commit/65311c6f472de67b368d83441ca5e93da86161f4

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-11-29 08:57:00 +08:00
Christian ClasonandChristian Brabandt 078e8e57d3 vim-patch:7e501f4: runtime(gzip): load undofile if there exists one
fixes: vim/vim#16102
closes: vim/vim#16122

https://github.com/vim/vim/commit/7e501f4d9986866382888e67d8f11faf5767c8f4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-27 08:45:22 +01:00
zeertzjqandGuyBrush 21371c9259 vim-patch:d7745ac: runtime(netrw): Fixing powershell execution issues on Windows (#31333)
closes: vim/vim#16094

https://github.com/vim/vim/commit/d7745acbd8fe1e4feb356a6dc7fc185eeab17d67

Co-authored-by: GuyBrush <miguel.barro@live.com>
2024-11-24 14:46:21 +00:00
Christian ClasonandChristian Brabandt 46d124a933 vim-patch:cacfccf: runtime(netrw): update netrw's decompress logic
Detect a few more default archive types, correctly handle file
extensions with digits in it.

fixes: vim/vim#16099
closes: vim/vim#16104

https://github.com/vim/vim/commit/cacfccf803949e62a29c85d4525372a10ea7e070

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-23 14:08:16 +01:00
Christian ClasonandKonfekt c9045f5ba3 vim-patch:460799d: runtime(netrw): small fixes to netrw#BrowseX
- do not enter dir in Netrw on opening
- double quotes after start cause error on Windows

See @chrisbra 's comments at
[0]

[0]: https://github.com/techntools/vim/commit/ff82e7a9dbef1cf98525be3186d65f450390e3b7#diff-39baf27d8f62071617bbef12f874cce31c0ebd02ec99e7b119474ca870c636a3R5279

https://github.com/vim/vim/commit/460799d885feeabd57b4e9336c513e53b2c7c86f

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-15 09:32:15 +01:00
Christian ClasonandLennart00 c026a114b5 vim-patch:129a844: runtime(tar): Update tar.vim to support permissions
These changes enable tar.vim to keep permissions of files that were
edited intact instead of replacing them with the default permissions.

The major change for this is switching from "tar -OPxf", which reads out
the contents of the selected file from an tar archive to stdout to
"tar -pPxf" which extracts the selected file to the current directory
with permissions intact

This requirs the temporary directory to be created earlier.

closes: vim/vim#7379

https://github.com/vim/vim/commit/129a8446d23cd9cb4445fcfea259cba5e0487d29

Co-authored-by: Lennart00 <73488709+Lennart00@users.noreply.github.com>
2024-11-12 08:18:22 +01:00
zeertzjqandChristian Brabandt 7906532e08 vim-patch:5b63b23: runtime(netrw): directory symlink not resolved in tree view (#31161)
closes: vim/vim#16020

https://github.com/vim/vim/commit/5b63b236a0af198f6c3c9883a3f6344b110dabb3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-11 07:52:11 +00:00