Skip to content

refactor!: :ZPack with subcommands#22

Merged
zuqini merged 1 commit into
zuqini:mainfrom
yavorski:main
May 17, 2026
Merged

refactor!: :ZPack with subcommands#22
zuqini merged 1 commit into
zuqini:mainfrom
yavorski:main

Conversation

@yavorski

Copy link
Copy Markdown
Contributor

Hmm, Messed up the branch the other PR was closed ...

This PR contains all the things discussed in #21

@zuqini zuqini left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for the contribution!

@zuqini zuqini merged commit 1a9f48f into zuqini:main May 17, 2026
2 checks passed
zuqini added a commit that referenced this pull request May 17, 2026
Non-blocking issues surfaced while reviewing the :ZPack subcommand
refactor and its cmd_prefix deprecation shim.

commands.lua:
- complete_command strips the command word explicitly, so a bang-attached
  subcommand (:ZPack!load) no longer mis-parses and offers subcommand names
  at the plugin-name position
- the dispatcher rejects a bang on subcommands that ignore it
  (update/restore/clean), restoring the feedback the old :ZUpdate! E477 gave
- the dispatcher rejects extra positional args instead of joining them into
  a misleading 'Plugin "a b" not found in spec' error
- validate_name type-checks its input, so a non-string cmd_prefix/cmd_name
  no longer throws and aborts setup()
- setup_legacy threads the resolved cmd_name into legacy command descs and
  warnings instead of hardcoding :ZPack
- setup_legacy emits an error notice for an invalid cmd_prefix instead of
  returning silently
- a startup assert keeps SUB_ORDER in sync with the Sub table
- the cmd_prefix deprecation warning dedups once total, not once per command

tests:
- repurpose cmd_prefix_test.lua as an explicit legacy-shim test: rename the
  describe block, assert the deprecation warning fires, drop the rejection
  cases duplicated by cmd_name_test.lua, and fix delete_zpack_commands
  cleanup calls that passed the prefix as the cmd_name positional
- add dispatch_test.lua covering the bang/extra-arg/completion fixes
- deprecation_test asserts the warning dedups across different legacy commands
- drop the :ZPack-creation test duplicated from cmd_name_test.lua
sairyy added a commit to sairyy/zshow.nvim that referenced this pull request May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants