1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-04-13 21:26:14 +02:00
Commit graph

122 commits

Author SHA1 Message Date
Konfekt
460799d885
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]: ff82e7a9db (diff-39baf27d8f62071617bbef12f874cce31c0ebd02ec99e7b119474ca870c636a3R5279)

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-14 21:42:27 +01:00
Christian Brabandt
5b63b236a0
runtime(netrw): directory symlink not resolved in tree view
closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-10 20:22:34 +01:00
Tom Benham
64a536d4fa
runtime(netrw): fix several bugs in netrw tree listing
fixes: 
fixes: 
fixes: 
closes: 

Signed-off-by: Tom Benham <tom.benham13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 21:31:49 +01:00
Christian Brabandt
a063b22b3b
runtime(netrw): prevent polluting the search history
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-07 14:31:09 +01:00
Tom Benham
4d618006ec
runtime(netrw): fix E874 when browsing remote directory which contains ~ character
closes: 

Signed-off-by: Tom Benham <tom.benham13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 10:47:23 +01:00
Christian Brabandt
8b0fa7a565
runtime(netrw): make :Launch/Open autoloadable
fixes: 
closes: 

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-31 09:21:23 +01:00
Christian Brabandt
9f32069b8c
runtime(netrw): fix regression with x mapping on Cygwin
related: 

Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-30 18:37:06 +01:00
Christian Brabandt
aa2ce6f580
runtime(netrw): fix filetype detection for remote files
fixes: 

while at it, remove the Decho comments in the s:NetrwOptionsRestore()
function

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-30 18:27:03 +01:00
Konfekt
3d7e567ea7
runtime(netrw): simplify gx file handling
It did not work very well, at least on Debian 12, and I am not sure Git
Bash and WSL, for example, were taken care of as maintenance stalled.

The whole logic was somewhat convoluted with some parts repeatedly invoking
failed commands.

The file handling was outdated, for example, nowadays Netscape is rarely
used, and also opinionated, for example mainly Microsoft Paint and Gimp for
Image files.

Instead, let's use (xdg-)open and similar commands on other systems
which respects the user's preferences.

closes: 

Co-authored-by: Luca Saccarola <96259932+saccarosium@users.noreply.github.com>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 22:16:49 +01:00
Luca Saccarola
a7d456191d
runtime(netrw): deprecate and remove netrwFileHandlers#Invoke()
closes: 

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-21 21:31:29 +02:00
Peter Aronoff
be551dacb8
runtime(netrw): remove extraneous closing bracket
fixes: 
closes: 

Signed-off-by: Peter Aronoff <peter@aronoff.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-22 11:29:40 +02:00
yasuda
c18a9d5835
runtime(netrw): using inefficient highlight pattern for 'mf'
Fixes E872 too many '(' in highlight pattern for `mf` selection

fixup for 
closes: 

Signed-off-by: yasuda <yasuda@kyoto-sr.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-19 18:09:51 +02:00
Christian Brabandt
0f5effbd1f
runtime(netrw): delete confirmation not strict enough
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-15 19:17:23 +02:00
yasuda
c75dad0177
runtime(netrw): Change line on mx if command output exists
closes: 

Signed-off-by: yasuda <yasuda@kyoto-sr.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-22 21:06:32 +02:00
yasuda
38cfa2b662
runtime(netrw): Fix mf-selected entry highlighting
closes: 

Signed-off-by: yasuda <yasuda@kyoto-sr.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-22 20:54:47 +02:00
Damien
1fbccc1e96
runtime(netrw): Drop committed trace lines
closes: 

Signed-off-by: Damien <141588647+xrandomname@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-15 22:01:24 +02:00
Damien
b4d1164425
runtime(netrw): Error popup not always used
Problem:  g:netrw_use_errorwindow=2 does not work
          without +balloon_eval.
Solution: Check for popup_atcursor().

related: 

Signed-off-by: Damien <141588647+xrandomname@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-15 22:00:45 +02:00
Damien
7c754110ff
runtime(netrw): ErrorMsg() may throw E121
Move variables declaration

related: 

Signed-off-by: Damien <141588647+xrandomname@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-15 22:00:10 +02:00
Ivan Shapovalov
c527d90fae
runtime(netrw): honor g:netrw_alt{o,v} for :{S,H,V}explore
Make `:Sexplore` / `:Hexplore` / `:Vexplore` commands honor the user
`&split{right,below}` settings (or netrw-specific `g:netrw_alt{o,v}`)
instead of hardcoding a split direction. Similarly, update banged
variants of the two latter commands to follow the inverted preference.

closes: 

Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-02 19:43:12 +02:00
Travis Shelton
e34d0e37e3
runtime(netrw): removing trailing slash when copying files in same directory
closes: 

Signed-off-by: Travis Shelton <tshelton.mail@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-30 21:10:38 +02:00
Christian Brabandt
581d4a7b35
runtime(netrw): escape filename before trying to delete it
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-23 21:14:06 +02:00
Damien
9d57ea5cd3
runtime(netrw): Fix endless recursion in netrw#Explore()
Problem:  ':E /etc BOOM' give E132 error.
Solution: Avoid recursion call with same arguments.

fixes: 
closes: 

Signed-off-by: Damien <141588647+xrandomname@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-22 20:25:34 +02:00
Enno
3146d63267
runtime(netrw): fix remaining case of register clobber
complements 62f7b55c1a

closes: 

Signed-off-by: Enno <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-04 19:45:36 +02:00
Christian Brabandt
62f7b55c1a
runtime(netrw): save and restore register 0-9, a and unnamed
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-23 20:23:40 +02:00
Christian Brabandt
440746158c
runtime(netrw): correctly test for windows in NetrwGlob()
use has("win32") instead of has("win64") otherwise it
won't work on x86 systems.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-14 08:19:22 +02:00
Christian Brabandt
1487947fb6
runtime(netrw): glob() on windows fails with [] in directory name
fixes: 
closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-13 21:25:35 +02:00
Christian Brabandt
98b73eb645
runtime(netrw): prevent accidental data loss
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-04 18:18:16 +02:00
Christian Brabandt
43f2edc096
runtime(netrw): prefer scp over pscp
regression introduced in ce2ad9ffd7

The current logic is a bit funny, in that it checks for an executable of
scp, then pscp and if neither exists, it uses: scp :/
Anyway, let's fall back to the logic used before the above commit.

related: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-13 21:01:06 +02:00
Nir Lichtman
c16c4a21eb
runtime(netrw): Recursively delete directories by default with netrw delete command
closes: 

Signed-off-by: Nir Lichtman <nir@lichtman.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-10 23:43:29 +02:00
Nir Lichtman
ce2ad9ffd7
runtime(netrw): Remove hardcoded private.ppk logic from netrw
closes: 

Signed-off-by: Nir Lichtman <nir@lichtman.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-09 20:20:36 +02:00
Nir Lichtman
1e34b95e44
runtime(netrw): Remove and cleanup Win9x legacy from netrw
closes: 

Signed-off-by: Nir Lichtman <nir@lichtman.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-08 19:19:34 +02:00
Christian Brabandt
08d2401fbc
runtime(netrw): filetype not detected when editing remote files
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-03 22:47:54 +02:00
dkearns
4b715bdaf4
runtime(netrw): Fix typo in netrw#NetWrite ()
Fix typo in netrw#NetWrite (http) error message call.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-24 17:47:37 +01:00
Christian Brabandt
8fad5d5887
runtime(doc,netrw): update "Last Change header", remove trailing whitespace
Update Last-Change Header for netrw and doc/indent.txt, fix a trailing
whitespace in indent.txt and make CI happy.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-29 18:13:04 +01:00
Christian Brabandt
56b7da3c05
runtime(netrw): handle file/dir symlinks specifically in tree mode
fixes: 
related: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-29 17:48:14 +01:00
Christian Brabandt
f9ca139e3a
runtime(misc): announce adoption of various runtime files
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-19 20:46:49 +01:00
MiguelBarro
c46c21b4ca
runtime(netrw): fixing remote file removal via ssh ()
Make pattern, which retrieves the path component from e.g. 
`scp://user@host//opt/program/file.ext` non-greedy.

Signed-off-by: GuyBrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-31 20:07:17 +01:00
user202729
bdb9d9afba
runtime(netrw): Use :exec norm! <leftmouse> before :call mapping in netrw ()
fixes: 

Signed-off-by: user202729 <25191436+user202729@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-28 23:29:21 +01:00
K.Takata
a262d3f41b
runtime(netrw): Don't change global options ()
Originally reported at: https://github.com/vim-jp/issues/issues/1428
'isk' was unintentionally changed by netrw, regression
introduced in Commit: 71badf9547

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-24 20:10:19 +01:00
MiguelBarro
6e5a6c9965
runtime(netrw): minor changes to fix move cmd on windows ()
Signed-off-by: GuyBrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-17 21:35:36 +01:00
K.Takata
2357765304
runtime(netrw): Decode multibyte percent-encoding filename correctly ()
Use `printf("%c")` instead of `nr2char()` to handle '%xx' as a byte.

Close 

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-12 17:30:01 +01:00
K.Takata
71d0ba07a3
runtime(netrw): Sync with netrw 174b ()
* Import netrw v174b
* Revert unwanted changes
* Fix indent
* Revert some changes
* Update tags
* Break long line

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-09 19:21:05 +01:00
Christian Brabandt
fbd72d2d47
runtime(netrw): prevent E11 on FocusGained autocommand ()
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-19 20:22:18 +01:00
Christian Brabandt
9a775b4a2a
runtime(netrw): escape curdir in BrowseUpDir ()
fixes 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-14 20:09:07 +01:00
KSR-Yasuda
b52e7ac7c6
runtime(netrw): Fix w:netrw_bannercnt ref error with netrw_fastbrowse=2 ()
* NetRW: Fix `w:netrw_bannercnt` ref error with `netrw_fastbrowse=2`
* NetRW: Fix wrong `w:netrw_bannercnt` setting

closes:  

Signed-off-by: yasuda <yasuda@kyoto-sr.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-11 17:11:43 +01:00
K.Takata
8750e3cf81
runtime(netrw): Fix handling of very long filename on longlist style ()
If there is a file with a very long filename (longer than
g:netrw_maxfilenamelen), and if g:netrw_liststyle is set to 1, no space
is inserted between the filename and the filesize and the file cannot be
opened because of this.

E.g.:
```
$ echo hello > 12345678901234567890123456789012	  # 32 bytes: OK
$ echo hello > 123456789012345678901234567890123  # 33 bytes: not OK
$ echo hello > 1234567890123456789012345678901234 # 34 bytes: not OK
$ echo hello > こんにちは                         # multibyte filename
$ LC_ALL=C.UTF-8 vim . --clean --cmd "set loadplugins" --cmd "let g:netrw_liststyle=1"
```

Then, it will be shown like this:
```
" ============================================================================
" Netrw Directory Listing                                        (netrw v171)
"   /cygdrive/c/work/netrw-test
"   Sorted by      name
"   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:special
" ==============================================================================
../                              0 Mon Mar 13 19:25:16 2023
./                               0 Mon Mar 13 19:44:58 2023
12345678901234567890123456789012 6 Mon Mar 13 19:29:43 2023
12345678901234567890123456789012346 Mon Mar 13 19:32:40 2023
1234567890123456789012345678901236 Mon Mar 13 19:29:49 2023
こんにちは                  6 Mon Mar 13 19:30:41 2023
```

If the length of the filename is 32 bytes, there is a space between the
filename and the filesize. However, when it is longer than 32 bytes, no
space is shown.

Also, you may find that the filesize of the multibyte named file is not
aligned.

After this patch is applied, the filelist will be shown like this:
```
" ============================================================================
" Netrw Directory Listing                                        (netrw v171)
"   /cygdrive/c/work/netrw-test
"   Sorted by      name
"   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:special
" ==============================================================================
../                                             0 Mon Mar 13 20:49:22 2023
./                                              0 Mon Mar 13 21:12:14 2023
1234567890123456789012345678901             10000 Mon Mar 13 20:57:55 2023
12345678901234567890123456789012                6 Mon Mar 13 19:29:43 2023
123456789012345678901234567890123               6 Mon Mar 13 19:29:49 2023
1234567890123456789012345678901234              6 Mon Mar 13 19:32:40 2023
1234567890123456789012345678901234567       10000 Mon Mar 13 21:03:23 2023
1234567890123456789012345678901234567890    10000 Mon Mar 13 21:03:36 2023
123456789012345678901234567890123456789012  10000 Mon Mar 13 21:03:59 2023
1234567890123456789012345678901234567890123  10000 Mon Mar 13 21:03:45 2023
1234567890123456789012345678901234567890123456  5 Mon Mar 13 21:08:15 2023
12345678901234567890123456789012345678901234567  10 Mon Mar 13 21:05:21 2023
こんにちは                                      6 Mon Mar 13 19:30:41 2023
```

Now we have 32 + 2 + 15 = 49 characters for filename and filesize.
It tries to align the filesize as much as possible.
The last line that has multibyte filename is also aligned.

Also fixed the issue that the file list is not shown correctly when
g:netrw_sort_by is set to 'size' and g:netrw_sizestyle is set to 'h' or
'H'.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-22 10:20:01 +01:00
Christian Brabandt
cb0c113ddc
runtime(netrw): expand $COMSPEC without applying 'wildignore' ()
When expanding $COMSPEC and a user has set :set wildignore=*.exe
netrw won't be able to properly cmd.exe, because it does not ignore the
wildignore setting.

So let's explicitly use expand() without applying the 'wildignore' and
'suffixes' settings to the result

closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-21 19:48:16 +01:00
nwounkn
650dcfc8d1
runtime(netrw): don't echo empty lines ()
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-27 19:07:38 +02:00
Viktor Szépe
dbf749bd5a
runtime: Fix more typos ()
* Fix more typos

* Fix typos in ignored runtime/ directory

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-16 09:53:37 +02:00
KSR-Yasuda
0e95841004
runtime(netrw): diff (df) may open the wrong window ()
closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:37:15 +02:00