dominictarr / hipster

MIT License
73 stars 8 forks source link

modular headers/footers #7

Open dominictarr opened 12 years ago

dominictarr commented 12 years ago

@maks, after your search plugin, I'm thinking we need to enhance support for more flexible headers/footers.

We should be able to generalize your plugin into two parts: a prompt where a plugin can ask a question, and a notice, where the plugin notifies the user about something.

I'm thinking something like:

prompt('search:', function (err, term) {

})

I'm thinking the right way is to use multiple `Document` objects, and render them to multiple views, sending the keys to the one that is currently focused. this would allow you to search copy-paste into the search box and stuff like that. Quite a bit of refactor to do here...
maks commented 12 years ago

@dominictarr yes it would be much nicer to have a a propmt function for all plugins to use. And I had t punt on displaying a no matches mesg (and just wrote it to console.error) because of lack of easy way to display a user notification.

I'd also suggest having a separate 'statusbar' area in the footer to display thing like the lines plugin does now,

Also with using documents for header and footer, I think there should be a container for model for them plus the 'active' document that is actually being edited. Perhaps "workspace" as a name? It could then be where things like the propmt method reside and so we won't need to expose the actual doc object that is 'backing' the footer for instance.

I'll have a go at implementing this idea on a branch and see how it pans out...