Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Massive refactor and a bug fix #102

Merged
merged 20 commits into from
Jan 16, 2023
Merged

Massive refactor and a bug fix #102

merged 20 commits into from
Jan 16, 2023

Conversation

mamaraddio
Copy link
Member

@mamaraddio mamaraddio commented Jan 13, 2023

I tried to refactor the zap codebase

  • Starting with install.zsh:
  • next in completion/_zap:
    • used a more simple way to define completion
    • changed flagged options (example zap --update) to subcommands (example zap update)
  • finally in zap.zsh:
    • a huge code refactor and (in my opinion) a small quality improvement
    • added return values on errors
    • removed the use of installed_plugins file (thus avoiding issue no such file or directory: /home/$USER/.local/share/zap/installed_plugins #89), now the installed plugins are stored in a zsh indexed array
    • refactored _try_source and plug functions
    • refactored _pull and _zap_update to avoid endless cd through directories
    • refactored _zap_clean to fetch the new $ZAP_INSTALLED_PLUGINS array (rather than looking for a file)
    • when answering Y or N to zap clean, now it reads the answer without having to confirm with ENTER (i think it's better)
    • zap help doesn't need an additional file anymore
    • zap version now shows version tag, branch and commit hash
    • refactored zap function to fetch previous changes

@mamaraddio mamaraddio added enhancement New feature or request and removed enhancement New feature or request labels Jan 14, 2023
@wintermi
Copy link
Contributor

Just entering the command zap returns Invalid option, see "zap help", could we not default to the same output as zap help. Which is what the current release does.

@wintermi
Copy link
Contributor

Executing the zap update command, I noticed that first line is out of alignment.

 0  ⚡ Zap
1  🔌 zsh-autosuggestions
2  🔌 zsh-syntax-highlighting
3  🔌 zsh-autopair

@wintermi
Copy link
Contributor

When executing a zap update command, entering 0 to update itself, I get the following output:

🔌 Plugin Number | (a) All Plugins | (0) ⚡ Zap Itself: 0
⚡ zap updated!
⚡ plugins updated!

What plugins was updated?

@mamaraddio
Copy link
Member Author

When executing a zap update command, entering 0 to update itself, I get the following output:

🔌 Plugin Number | (a) All Plugins | (0) ⚡ Zap Itself: 0
⚡ zap updated!
⚡ plugins updated!

What plugins was updated?

Let me try

@mamaraddio
Copy link
Member Author

Fixed both alignment and updating zap itself

@mamaraddio
Copy link
Member Author

Please, continue let me know if new bugs pop up

@wintermi
Copy link
Contributor

wintermi commented Jan 16, 2023

After the latest commit, I am no longer able to update "All Plugins", when I enter in a it updates Zap iteself only.

@mamaraddio
Copy link
Member Author

After the latest commit, I am no longer able to update "All Plugins", when I enter in a it updates Zap iteself only.

I go work to a different approach to try solve this, thanks again for being my "beta tester" 🙂

@mamaraddio
Copy link
Member Author

Let's test again please 🙏

Copy link
Contributor

@wintermi wintermi left a comment

Choose a reason for hiding this comment

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

All tests were successful.

@wintermi wintermi merged commit 4928ff8 into master Jan 16, 2023
@wintermi wintermi deleted the mamaraddio-patch branch January 16, 2023 13:27
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.

no such file or directory: /home/$USER/.local/share/zap/installed_plugins
2 participants