262 Commits

Author SHA1 Message Date
J. Paulo Seibt 7ccc273a4c patch 9.2.0446: runtime(netrw): off-by-one bug in s:NetrwUnMarkFile()
Problem:  off-by-one bug in s:NetrwUnMarkFile()
Solution: Correctly loop through all buffers to unlet all variables
          (J. Paulo Seibt)

When the function loops through buffers to clear s:netrwmarkfilelist_#
and s:netrwmarkfilemtch_#, it skips the last one at bufnr('$'), messing
up mark highlights and causing other functions that operate on those
arrays (like delete or rename) to target stale marked files.

The bufnr() help page says that bufnr("$") returns the highest buffer
number of existing buffers, so while ibuf < bufnr("$") does not clear
the last buffer-local arrays.

To reproduce:

Just opening a fresh Vim and running :Ex opens a netrw buffer at the
highest number. Then, typing mu after marking some files triggers the
mark highlight bug, and finally typing D would act like calling the
delete function against the previous marked files, as the buffer-local
arrays where not touched by s:NetrwUnMarkFile.

closes: #20129

Signed-off-by: J. Paulo Seibt <jpseibt@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-05 20:09:58 +00:00
Christian Brabandt 405e2fb6d5 patch 9.2.0383: [security]: runtime(netrw): shell-injection via sftp: and file: URLs
Problem:  runtime(netrw): shell-injection via sftp: and file: URLs
          (Joshua Rogers)
Solution: Escape temporary file names, harden filename suffix regex,
          drop unused g:netrw_tmpfile_escape variable

Supported by AI

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-04-21 19:08:05 +00:00
Yasuhiro Matsumoto 723c0acf25 patch 9.2.0367: runtime(netrw): ~ note expanded on MS Windows
Problem:  runtime(netrw): ~ note expanded on MS Windows
          (Tom Vamvanij)
Solution: Expand ~ on MS Windows (Yasuhiro Matsumoto)

On Windows, ":Explore ~" did nothing because the tilde expansion was
gated to Unix/Cygwin only.  Additionally, substitute() interprets
backslashes in the replacement string specially (e.g. \U as a case
modifier), which would corrupt $HOME values like C:\Users\name even
if the branch were taken.

Include has("win32") in the guard, anchor the pattern to the start of
the string, and escape backslashes, ampersands and tildes in $HOME
before substituting.

fixes:  #20003
closes: #20014

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-04-19 20:40:58 +00:00
Yasuhiro Matsumoto 21c0cd29f8 runtime(netrw): add missing escape() calls
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-04-15 20:47:29 +00:00
Christian Brabandt 01be43047f runtime(hlyank): verify winid in lambda before matchdelete()
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-04-11 14:53:48 +00:00
Christian Brabandt ab4ebb62ee patch 9.2.0302: runtime(netrw): RFC2396 decoding double escaping spaces
Problem:  runtime(netrw): RFC2396 decoding double escaping spaces
          (lilydjwg, after 3e60f03d94)
Solution: Remove escape() call, since we are using fnameescape() anyhow

fixes: #19913

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-04-05 16:36:42 +00:00
Christian Brabandt 3e60f03d94 runtime(netrw): use fnameescape() with FileUrlEdit()
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-04-01 14:47:16 +00:00
Yinzuo Jiang 5890ea5397 patch 9.2.0143: termdebug: no support for thread and condition in :Break
Problem:  termdebug :Break does not support `thread` and `if` arguments
Solution: extend :Break and :Tbreak to accept optional location, thread
          {nr}, and if {expr} arguments (Yinzuo Jiang).

closes: #19613

Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-12 18:34:37 +00:00
Miguel Barro a6198523fb patch 9.2.0089: netrw: does not take port into account in hostname validation
Problem:  netrw: does not take port into account in hostname validation
          (after v9.2.0073)
Solution: Update hostname validation check and test for an optional port
          number (Miguel Barro)

closes: #19533

Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-01 19:33:17 +00:00
mikoto2000 5a4291d34e runtime(osc52): Omit paste from the osc52 provider when g:osc52_disable_paste is enabled
Omit paste capability from the osc52 provider when g:osc52_disable_paste
is enabled This avoids OSC 52 paste queries on unsupported terminals and
prevents the +/* registers from being treated as empty. Documentation
updated accordingly.

related: #18983
closes:  #19542

Signed-off-by: mikoto2000 <mikoto2000@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-01 19:23:34 +00:00
Christian Brabandt 79348dbbc0 patch 9.2.0073: [security]: possible command injection using netrw
Problem:  [security]: Insufficient validation of hostname and port in
          netrw URIs allows command injection via shell metacharacters
          (ehdgks0627, un3xploitable).
Solution: Implement stricter RFC1123 hostname and IP validation.
          Use shellescape() for the provided hostname and port.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-m3xh-9434-g336

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-02-27 20:29:14 +00:00
Miguel Barro bd1dc5b1a6 patch 9.2.0037: netrw: need better tests for absolute paths
Problem:  netrw: need better tests for absolute paths
Solution: Use absolutepath(), instead of regex test (Miguel Barro).

closes: #19477

Signed-off-by: Guybrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-02-21 10:26:21 +00:00
Miguel Barro a2d87ba615 runtime(netrw): Use right file system commands initialization for Windows
closes: #19287
fixes:  #12290

Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-02-15 15:51:27 +00:00
Bozhidar Batsov b2d11a9de2 runtime(doc): Fix typos in markdown READMEs
closes: #19394

Signed-off-by: Bozhidar Batsov <bozhidar@batsov.dev>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-02-13 16:08:24 +00:00
Peter Kenny 754fc64d2e runtime(helpcurwin): fix E121 error
closes: #19270

Signed-off-by: Peter Kenny <github.com@k1w1.cyou>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-01-28 21:45:50 +00:00
Christian Brabandt 4e2aafddbb runtime(netrw): Do not create swapfiles in netrw buffers
Problem:  When using netrw to navigate directories, vim immediately
          creates, then deletes a swap file in the entered directory,
          causing the lastModifiedTime of that directory to change.
Solution: Use the :noswapfile command modifier in s:NetrwEditFile()

fixes: #18854

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-01-19 19:26:09 +00:00
Jon Parise ec46b9d4f2 runtime(matchit): include minor improvement from chrisbra/matchit
In particular, documentation update from
related: chrisbra/matchit#55

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-01-13 19:40:40 +00:00
zeertzjq 6a2b5b2246 patch 9.1.2078: A few more typos in various files
Problem:  A few more typos in various files
Solution: Fix those (zeertzjq, antonkesy)

related: neovim/neovim#37348
closes:  #19153

Co-authored-by: Anton Kesy <anton@kesy.de>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-01-11 18:59:51 +00:00
Christian Brabandt e80a4ed845 runtime(matchit): Update to Release 1.21
closes: #19109

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-01-08 20:53:40 +00:00
tao 538da34ad3 runtime(netrw): Fix reading UNC paths on windows
Problem:  When Vim is launched with a UNC directory, netrw treats it as a
          relative path and compose it again.
Solution: This is due to `exists("g:netrw_cygwin")` always being true.
          We can directly use `g:netrw_cygwin`.

closes: #19015

Signed-off-by: tao <2471314@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-12-26 15:51:32 +00:00
Miguel Barro c721b69e88 runtime(termdebug): update v:shell_error condition test.
vim9 conditions only admit 0 or 1 integers, however the return value of
shells is not limited to either 0 or 1 (e.g. powershell)

closes: #19010

Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-12-26 15:19:41 +00:00
Foxe Chen e6a11d45e5 runtime(osc52): A few minor fixes
- If g:osc52_disable_paste is enabled, then return an empty list instead
  of a list with a single empty string.
- use `echo` instead of `echom` when printing osc waiting message

closes: #19002

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-12-26 14:59:01 +00:00
Foxe Chen 5fb29bb7e7 runtime(osc52): Update documentation, send DA1 query when loading package
closes: #18944

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-12-18 22:15:05 +01:00
Foxe Chen b9e45e82ba patch 9.1.1988: osc52 package can be further improved
Problem:  osc52 package can be further improved (after v9.1.1984).
Solution: Improve plugin, update test and check for clipboard_provider
          feature (Foxe Chen).

closes: #18935

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-12-16 20:35:53 +01:00
Foxe Chen 02b8ec7da5 patch 9.1.1984: terminal OSC52 support can be improved
Problem:  terminal OSC52 support to access the clipboard can be improved
Solution: Include and package the optional osc52 package, note: this
          requires a Vim with clipboard provider feature (Foxe Chen).

related: #14995
closes: #18575

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-12-15 21:52:32 +01:00
Peter Kenny c0f2d2f140 patch 9.1.1946: Cannot open the help in the current window
Problem:  Cannot open the help in the current window
Solution: Promote the example from tips.txt to a proper package and
          include the helpcurwin package, add tests for it
          (Peter Kenny)

closes: #18840

Signed-off-by: Peter Kenny <github.com@k1w1.cyou>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-12-02 20:42:53 +00:00
Christian Brabandt ab090993ad runtime(netrw): fix undefined variable curwin in s:NetrwMenu()
fixes: #18829

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-11-28 22:37:06 +00:00
Miguel Barro 040a47a470 runtime(netrw): Use proper UNC notation for temp files
closes: #18764

Signed-off-by: Guybrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-11-18 20:06:06 +00:00
Christian Brabandt 384685fade patch 9.1.1914: runtime(netrw): wipes unnamed buffers
Problem:  runtime(netrw): LocalBrowseCheck() wipes unnamed buffers when
          g:netrw_fastbrowse=0 (Carlos Falgueras García)
Solution: Check that bufname() is not empty

fixes: #18740
closes: #18741

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-11-13 21:11:51 +00:00
Mohammad Reza Karimi fe71c56d8f runtime(netrw): NetrwChgPerm for files not in cwd
Problem:  Changing permissions fail when using `gp` if the file under
          the cursor is not in the current working directory.
Solution: Use the already available `a:curdir` argument and prepend it
          to the `<cfile>`, so that the path of the file is correct.

This commit also refactors some leftover `netrw#ErrorMsg` to
`netrw#msg#Notify` (the main refactoring was done in
f5e3b5c04f).

closes: #18674

Signed-off-by: Mohammad Reza Karimi <m.r.karimi.j@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-11-01 15:46:04 +00:00
Aliaksei Budavei 4105ef16e3 Drop superfluous execute permissions for readable files
- runtime/ftplugin/plsql.vim (42e498)
- runtime/pack/dist/opt/editorconfig/LICENSE.PSF (e5e043)
- src/po/check.vim (96dab9)
- src/po/it.po (bb0d3b)

closes: #18666

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-10-30 19:05:03 +00:00
zeertzjq 58ab3438b7 runtime(netrw): fix misaligned comment after #18611
related" #18611
closes: #18644

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-10-27 18:04:22 +00:00
Václav Kobera f17f78c557 patch 9.1.1875: username parsing bug in netrw plugin
Problem:  username parsing bug in netrw plugin when using remote adding
          feature
Solution: Allow any characters except for "@" (Václav Kobera), add a
          test for the netrw plugin

closes: #18611

Signed-off-by: Václav Kobera <vasekobera@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-10-26 18:21:04 +00:00
Hirohito Higashi 1b565eee6d Fix incorrect spelling of Vim script and Vim9 script
closes: #18591

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-10-17 17:50:29 +00:00
Miguel Barro 3c5221f8ee runtime(termdebug): Add remote debugging capabilities
closes: #18429

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-10-08 18:15:51 +00:00
Miguel Barro 8337d77eff runtime(netrw): MS-Windows: fix netrw not being able to navigate to parent folder
fixes: #18421
closes: #18464

Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-10-01 19:45:38 +00:00
zeertzjq 1ae980a9cb runtime(doc): fix inconsistent indent in cmdline.txt
Also fix typo in autoload/netrw.vim.

related: #18371
closes: #18376

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-24 18:01:29 +00:00
Christian Brabandt 58304078ad runtime(netrw): 'equalalways' is not always respected
fixes: #18358

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-23 18:13:28 +00:00
Hirohito Higashi 5bf41e7418 runtime(netrw): update regex to handle remote archives
closes: #18318

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-17 20:39:10 +00:00
Simon Sobisch 049c76f0e8 runtime(termdebug): drop outdated comment from termdebug.vim
that was an internal note which somehow slipped in months ago and even
survived the change to Vimscript9

closes: #18305

Signed-off-by: Simon Sobisch <simonsobisch@web.de>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-15 19:49:32 +00:00
bennyyip c975d62473 patch 9.1.1756: termdebug: Need a few more user commands
Problem:  termdebug: Need a few more user commands
Solution: Add the :RunOrContinue and the :ToggleBreak user commands
          (bennyyip)

closes: #18283

Signed-off-by: bennyyip <yebenmy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-14 04:33:07 -04:00
Tom Benham 9e100b8d14 runtime(netrw): only keep cursor position in tree listing mode
fixes: #16255
closes: #18275

Signed-off-by: Tom Benham <tom.benham13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-11 15:15:43 -04:00
Miguel Barro 5f836749fa runtime(netrw): Ensure netrw#fs#Dirname() always returns a trailing slash
closes: #18199

Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-05 11:35:00 +02:00
bennyyip 884290ebf0 patch 9.1.1728: termdebug: cannot evaluate visual selected expression
Problem:  termdebug: cannot evaluate visual selected expression
Solution: Add support for visual mode, mapped to K by default (bennyyip)

closes: #18184

Signed-off-by: bennyyip <yebenmy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-02 20:06:20 +02:00
Yegappan Lakshmanan fdd93e0999 runtime(termdebug): Remove load guard
closes: #18098

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-24 12:19:20 +02:00
Jason Long 53466887f7 runtime(netrw): fix :Explore command in terminal
There are really two issues solved here:

- The directory listing was not populating the new buffer when using
  the :Explore command. This was because the directory to open is
  determined by using expand("%:p") which includes '!/running/command' at
  the end of the string in terminal buffers.

- The :Explore command should replace the buffer, not split it. This
  because the Explore command will automatically split if the current
  buffer has been modified. According to the docs, all terminal buffers
  will have the modified flag set when a job is running.

fixes: #9862
closes: #18069

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-23 17:44:32 +02:00
Damien Lejay 32d6bd6df2 runtime(doc): remove dead links
related: #17879

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:28:16 +02:00
Hirohito Higashi 57eb1d496b runtime(doc): Tweak documentation style
closes: #17959

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 09:12:46 +02:00
Christian Brabandt 6a6a44ffb5 runtime(netrw): netrw#BrowseX() needs to distinguish local and remote file
fixes: #17794

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 20:23:16 +02:00
veotos c849b17e19 runtime(netrw): Use correct "=~#" for the netrw_sizestyle='H' option
Correct expression syntax to match case in if and if-else clauses.

related: #8535
closes: #17901

Signed-off-by: veotos <veotos@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 15:48:11 +02:00