Tabs and command-line utility

April 2017 · 2 minute read

Today I’m happy to release the Marta 0.2! This release brings the tabs support, Terminal integration and a number of API enhancements.

Tabs Support

Tabs really matter. It was one of the most awaited features of Finder. Of course, you could open multiple windows before, but switching between windows is not so convenient as tab switching. So it was one of the critical features for Marta from the very beginning, and now it’s here!

Tab support

As in other applications, press ⌘T to open the new tab and ⌘W to close the active one.
You can also switch between open tabs using ⌘1..9. Of course, tab layout is saved on exit.

Terminal integration

The Marta’s command-line runner worked since 0.1 but it had some bugs that refrained me from publishing the setup instructions. Now those bugs are fixed so now you can launch Marta directly from the Terminal like this:

marta ~  
marta ./Documents/Work ~/Downloads

You can read about how to set up the command-line runner here.

API changes

Because of the early stages, Marta API evolves significantly. This means there’s need to make breaking changes sometimes, and plugins should be aware of that. So Marta 0.2 introduces the API version in the format major.minor (the API version in Marta 0.2 is 2.0). More information is provided in the API Reference.

The other major change in the API is about modifying the ActionContext. Sometimes you may need to invoke some other action with the custom context, for example passing just a few of the selected files. Because ActionContext, PaneContext, and MutableListModel are protocols, you could write your own implementation of those, but in this case, you need to implement a lot of members.

class MyModel : DelegateMutableListModel {
    // Here you can write custom implementations of MutableListModel methods
}

class MyAction : Action {
    func apply(context: ActionContext) {
        let newModel = MyModel(delegate: context.activePane.mutableModel)
        let newContext = context.clone(newModelForActiveTab: newModel)
        context.globalContext.actionRepository["action.name"]?.apply(context: newContext)
    }
}

Feedback

The Marta issue tracker is on Github.
Feel free to submit new issues and vote for the existing ones :)

Have a happy Marta!