prise plugin system: initial plugin support for prise #85
prise plugin system: initial plugin support for prise #85jossephus wants to merge 8 commits intorockorager:mainfrom
Conversation
6811334 to
d7bfbb2
Compare
|
This PR is only POC, feel free to close it since I may have too many unhandled things. |
|
This. Is. Amazing. I am all for this, and I'm fine putting it out in pieces if you prefer that - prise is alpha, after all! |
There was a problem hiding this comment.
Review Summary
This PR adds a solid plugin system foundation with good Lua/Zig integration. The test coverage for the Lua side is thorough.
Key issues to address:
-
TigerStyle violation:
ensurePluginis 136 lines (limit: 70). Split into smaller helper functions. -
Blocking git operations:
std.process.Child.runwill freeze the UI during clone/fetch. Consider async execution or user feedback. -
Redundant code:
load_for_event()iterates all specs unnecessarily since events are already indexed during setup.
Minor:
- Comment in
matcherKeyToStringsays 11 chars overhead but it's actually 10 - Magic number
512for URL buffer should be a named constant
The Lua plugin manager is well-structured with proper error handling and EmmyLua annotations. The hook system and lazy loading implementation look correct.
Review thread: https://ampcode.com/threads/T-019bafe2-c320-76dc-b898-2a5baaaab386
- fix dangling memory leak risk - fix a timer leak - fix callback queue issues in plugins.lua - properly update git clone status for 'clone' and 'update'
3890977 to
912329d
Compare
…to username/repo-name


This is my attempt to add plugin support to prise. Its heavily inspired by how lazy.nvim configures plugins and how plugins work in Neovim.
a sample theme switcher plugin is available at https://github.com/jossephus/prise-theme-switcher and you can see the video below to see it in action.
Plugin System for Prise
Adds plugin support inspired by lazy.nvim's configuration style.
Features
username/repoformat)./path,~/path,/absolute/path)eventorkeystriggersPlugin Directory
Plugins are cloned to
~/.local/share/prise/plugins/Configuration Example
Writing Plugins
Plugins follow a simple Lua module pattern. Place your plugin code in lua//init.lua or lua/.lua.
Minimal plugin:
Directory structure:
my-prise-plugin/
└── lua/
└── my-prise-plugin/
└── init.lua -- or just lua/my-prise-plugin.lua
Future Work
Here is a video, using a sample simple https://github.com/jossephus/prise-theme-switcher in prise.
output.mp4
and the code needed to include this plugin in my init.lua is the following
and the following part in tab_bar.render so we can show the current theme in tab bar as shown in the video
initial working amp thread: https://ampcode.com/threads/T-019ba5f4-93c1-7378-887a-d8c3dd1305f9