jisaacks / MaxPane

Sublime Text plugin to quickly maximize a pane in a multi pane layout without resetting the layout.
MIT License
78 stars 9 forks source link

May I use MaxPane as part of my Sublime Text plugin? #14

Closed pykong closed 7 years ago

pykong commented 7 years ago

Hi jisaacks,

first of all thank you for MaxPane! :+1: You identified a problem and solved that many of us Sublime users share. Indeed sometimes we just need to focus on that single file, regardless of how the layout maybe.

I have just written my own first sublime plugin and I like to share it with the community. I call it TwoColumns and as its name implies it ensures a two column layout - always, automagically and on every window.

You can find it here: TwoColumns

For a user who always stick to one layout this is so much simpler to use than Origami which requires her to trigger a specific command every time she like to open a new window with her desired layout.

Yet, I would also add one additional function: Maximizing a pane. As in my experience often times it is necessary to use the full screen width when working with very long lined files or if focus on just a single file is desired.

This led me straight to your plugin. Unfortunately I do not see any other way to marry TwoColumns and MaxPane than having them in the same plugin and make them communicate with each other. The core issue is that TwoColumns overwrites the action of MaxPane every time the latter attempts to change the layout.

So I did exactly that.

I know it is called open source and MIT license . Still MaxPane is your code and the result of your work. Therefore I feel it is only polite to ask if I could use it as part of TwoColumns, before I introduce it to the Sublime community.

Thanks.

You can find it here: TwoColumns

Best regards, Ben

P.S.: Of course I am going to include proper tribute to you.

jisaacks commented 7 years ago

@bfelder Thanks so much for reaching out, of course you have permission.

However, I think if you could solve the problem of making MaxPane and TwoColumns work together that would be ideal. The reason being is fragmentation. If a bug get's fixed here, it would need to also be fixed in TwoColumns and vice versa. I hope you see the issue.

So again, from a maintenance point of view, it makes sense to keep them separate if possible. I think sublime package control has a feature that allows you to set other packages as dependencies. Is there some that could be changed to make them work together?

Alternatively, you make your repo include this repo as a submodule, that way they can share big fixes and things like that. I could add you as a collaborator on this repo in that case.

Either way up to you what you want to do, but you are perfectly fine to use this code in any way :)

Cheers.

pykong commented 7 years ago

@jisaacks Thank you very much for your in-depth thoughtful reply and your permission!

Indeed I am strongly preferring to keep MaxPane outside of my TwoColumns plugin. As you mentioned there are various advantages of doing so, and I think there are not just from a maintenance perspective.

Thanks also for pointing out that sublime allows specifying other plugins as dependencies. I have not been aware of this! Can you point me to any example or documentation how to do this, as sublime's API doc is rather sparse?

Do you know a way to achieve this?

Thanks again!

jisaacks commented 7 years ago

A long while ago, I was working on making a git gutter engine. Basically extract out the diff parsing of my git gutter plugin and allow other plugins to be built on top of it. This is because so many people wanted to add extra features that required knowing the diff.

So in doing this, I needed to figure out a way to make plugins communicate with each other, and if I remember correctly I did solve that problem.

The problem is, this was a while ago, I ended up abandoning that idea because of time constraints. I do not know if I even have the branch anymore and I don't remember the implementation because it was too long ago. But I am pretty sure there is a way to make the plugins able to communicate. I will try and find that branch, and if not, see if I can figure that part out again. I am extremely busy these days though, with small children, primary developer for a new product that just launched at work, and also wrapping up the final bits of a book I am working on, so I can't promise how much time I can spend on this. I'll look for a link on the package depenencies docs, but I think it's a part of the package control plugin, not native sublime API.

pykong commented 7 years ago

I opened a thread on the Sublime forum to summon support for this cause: Thread

Do not worry. A paying job and family always have priority. Everyone understands this. So contribute in time and effort to solve this problem only what you can without stressing yourself out.

pykong commented 7 years ago

@jisaacks I have just opened a pull request. See if you can imagine to merge and release those. The function of MaxPane is not altered. Only a list of window ids is made available to other plugins via an in-memory .sublime-settings file.

pykong commented 7 years ago

@jisaacks A big thank you for the merge and the trust in me. I am sure the changes can be of use to any other developer who needs to run is layout plugin smoothly alongside MaxPane. I tested it two columns and the freshly updated MaxPane out and they work beautifully together. Like a match found in heaven. I am going to release TwoColumns on the weekend stay tuned. And thanks again!

jisaacks commented 7 years ago

No problem! :)