0
0
mirror of https://github.com/vim/vim.git synced 2025-08-25 19:53:53 -04:00

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>
This commit is contained in:
veotos 2025-08-07 15:48:11 +02:00 committed by Christian Brabandt
parent 93f6454724
commit c849b17e19
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -1,6 +1,8 @@
" Creator: Charles E Campbell " Creator: Charles E Campbell
" Previous Maintainer: Luca Saccarola <github.e41mv@aleeas.com> " Previous Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
" Maintainer: This runtime file is looking for a new maintainer. " Maintainer: This runtime file is looking for a new maintainer.
" Last Change:
" 2025 Aug 07 by Vim Project (use correct "=~#" for netrw_stylesize option #17901)
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code, " Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright " with or without modifications, provided that this copyright
@ -9225,7 +9227,7 @@ endfunction
" 1000 -> 1K, 1000000 -> 1M, 1000000000 -> 1G " 1000 -> 1K, 1000000 -> 1M, 1000000000 -> 1G
function s:NetrwHumanReadable(sz) function s:NetrwHumanReadable(sz)
if g:netrw_sizestyle == 'h' if g:netrw_sizestyle ==# 'h'
if a:sz >= 1000000000 if a:sz >= 1000000000
let sz = printf("%.1f",a:sz/1000000000.0)."g" let sz = printf("%.1f",a:sz/1000000000.0)."g"
elseif a:sz >= 10000000 elseif a:sz >= 10000000
@ -9240,7 +9242,7 @@ function s:NetrwHumanReadable(sz)
let sz= a:sz let sz= a:sz
endif endif
elseif g:netrw_sizestyle == 'H' elseif g:netrw_sizestyle ==# 'H'
if a:sz >= 1073741824 if a:sz >= 1073741824
let sz = printf("%.1f",a:sz/1073741824.0)."G" let sz = printf("%.1f",a:sz/1073741824.0)."G"
elseif a:sz >= 10485760 elseif a:sz >= 10485760