diff options
| author | Barrett Ruth <62671086+barrettruth@users.noreply.github.com> | 2026-07-29 11:54:43 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-29 12:54:43 -0400 |
| commit | e29af9c32f8be5767924b79612ce0f73877d2263 (patch) | |
| tree | dbb3e9c36ad3d54e664a1bc22f3f17274150e2fa /runtime/ftplugin/java.vim | |
| parent | 1dbc766fa71edee8d040815c5621b94c8ecdf68f (diff) | |
| download | rneovim-e29af9c32f8be5767924b79612ce0f73877d2263.tar.gz rneovim-e29af9c32f8be5767924b79612ce0f73877d2263.tar.bz2 rneovim-e29af9c32f8be5767924b79612ce0f73877d2263.zip | |
refactor(zip)!: builtin zip.lua plugin #40846
Problem:
The bundled `zip` plugin is implemented in Vimscript, making it harder to
maintain and build on with Nvim's Lua runtime infrastructure.
Solution:
Add an opt-out `zip.lua` browser backed by `nvim.dir`, and disable the legacy
Vimscript implementation by moving it to `pack/dist/opt/zip/`. Load it with
`:packadd zip`.
Diffstat (limited to 'runtime/ftplugin/java.vim')
| -rw-r--r-- | runtime/ftplugin/java.vim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim index 4a08c57dd4..00d0532dd6 100644 --- a/runtime/ftplugin/java.vim +++ b/runtime/ftplugin/java.vim @@ -68,7 +68,7 @@ unlet! s:zip_func_upgradable if exists("g:ftplugin_java_source_path") && \ type(g:ftplugin_java_source_path) == type("") if filereadable(g:ftplugin_java_source_path) - if exists("#zip") && + if (exists("#zip") || exists("#nvim.zip")) && \ g:ftplugin_java_source_path =~# '.\.\%(jar\|zip\)$' if !exists("s:zip_files") let s:zip_files = {} @@ -79,8 +79,9 @@ if exists("g:ftplugin_java_source_path") && let s:zip_func_upgradable = 1 function! JavaFileTypeZipFile() abort - let @/ = substitute(v:fname, '\.', '\\/', 'g') . '.java' - return get(s:zip_files, bufnr('%'), s:zip_files[0]) + let l:member = substitute(v:fname, '\.', '/', 'g') . '.java' + return 'zipfile://' . get(s:zip_files, bufnr('%'), s:zip_files[0]) . + \ '::' . l:member endfunction " E120 for "inex=s:JavaFileTypeZipFile()" before v8.2.3900. @@ -389,8 +390,8 @@ if exists("s:zip_func_upgradable") delfunction! JavaFileTypeZipFile def! s:JavaFileTypeZipFile(): string - @/ = substitute(v:fname, '\.', '\\/', 'g') .. '.java' - return get(zip_files, bufnr('%'), zip_files[0]) + const member: string = substitute(v:fname, '\.', '/', 'g') .. '.java' + return 'zipfile://' .. get(zip_files, bufnr('%'), zip_files[0]) .. '::' .. member enddef setlocal includeexpr=s:JavaFileTypeZipFile() |