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, 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:50:36 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
こんにちは 6 Mon Mar 13 19:30:41 2023
Now, two space characters are always inserted between the name and the size, and the last line is also aligned.
https://github.com/vim/vim/pull/12150
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
possibly fixes #10315
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@k-takata pushed 2 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Merging #12150 (93deb42) into master (e764d1b) will decrease coverage by
81.67%.
The diff coverage isn/a.
❗ Current head 93deb42 differs from pull request most recent head 0a9d9af. Consider uploading reports for the commit 0a9d9af to get more accurate results
@@ Coverage Diff @@ ## master #12150 +/- ## =========================================== - Coverage 81.95% 0.29% -81.67% =========================================== Files 164 154 -10 Lines 194086 179274 -14812 Branches 43828 40967 -2861 =========================================== - Hits 159069 522 -158547 - Misses 22183 178695 +156512 + Partials 12834 57 -12777
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-none | ? |
|
| huge-gcc-none | ? |
|
| huge-gcc-testgui | ? |
|
| huge-gcc-unittests | 0.29% <ø> (ø) |
|
| linux | 0.29% <ø> (-82.10%) |
⬇️ |
| mingw-x64-HUGE | ? |
|
| mingw-x86-HUGE | ? |
|
| windows | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
see 158 files with indirect coverage changes
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I've updated the patch to align the filesize.
E.g.:
" ============================================================================
" 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.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@k-takata pushed 2 commits.
You are receiving this because you are subscribed to this thread.![]()
Also fixed an 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'.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Cc: @cecamp
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Unfortunately my email is seriously broken at the moment, and I'm gone until next week. My website is down, too, btw. I'll look into this when I can.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I've tried Netrw v172 and it still has the above alignment and sort issues.
I've updated my patch for v172. Could you check it again?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Cf. https://groups.google.com/g/vim_dev/c/QCMDKKQrakQ
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This also fixes #4899.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Any updates on this?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra
I've confirmed that this has been already merged in Netrw v174b. However, it has not been included in this repository yet.
Can we merge this PR in advance?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
okay sure. Thanks!
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I was preparing to merge it. Can you please add a simple header line like this one:
https://github.com/vim/vim/blob/4e5c3cf07bfc904b2a558f1d08a7f8a9732ed7db/runtime/autoload/netrw.vim#L5-L6
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@k-takata pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@k-takata pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra Updated. Could you check it?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Updated the commit log.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Merged #12150 into master.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
thanks!
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()