dkandalov / tab-shifter

Plugin for IntelliJ IDEA to move and split editor tabs
https://plugins.jetbrains.com/plugin/7475
169 stars 12 forks source link

Make all windows same width & height action #8

Open nkgm opened 7 years ago

nkgm commented 7 years ago

Equivalent vim's `CTRL-W_='

robinmitra commented 6 years ago

I can take a stab at this. Any pointers on how I can get started?

dkandalov commented 6 years ago

@robinmitra Let me try to configure the project so that it works directly from gradle. I'll commit the changes today.

dkandalov commented 6 years ago

@robinmitra I committed gradle build file so now you should be able to build and run plugin using gradle (from command or IDE) as described here https://github.com/JetBrains/gradle-intellij-plugin (basically, gradle buildPlugin and gradle runIde).

In general, you should be able to set split window proportions with com.intellij.openapi.ui.Splitter#setProportion from IJ api. (FYI the code on master currently contains ToggleMaximizeRestore action which has couple problems and needs better implementation.)

robinmitra commented 6 years ago

Wonderful! I'll have a look soon.

jangxyz commented 3 years ago

It's been a while since this issue was first posted, but seems to be stuck.

Had a luxury to poke around a bit, and was lucky to make it work -- at least in my environment.

First time working with IntelliJ plugins, and all I did was a quick review on the source code together with the build system guide.

Hope this works and let me use the feature in IntelliJ platform. @dkandalov If you need any changes to be made, don't hesitate to tell.

Thanks.

dkandalov commented 3 years ago

@jangxyz thanks a lot for adding the action!

I made couple commits since your PR:

If that's ok, I'll release sometime this week.

Btw, just like with the "Maximize/Restore Splitter" there is a question about nested splitters, e.g. given the following layout (with nested splitter in the right half):

┌─┬─┐
│ │─│
└─┴─┘

when the cursor is in the bottom right tab, should all visible "windows" get an approximately equal size or just the nested split?

nkgm commented 2 years ago

Is this issue resolved? For a 3-column layout I get:

┌──┬─┬─┐
│  │ │ │
└──┴─┴─┘

while vim would be like:

┌─┬─┬─┐
│ │ │ │
└─┴─┴─┘
dkandalov commented 2 years ago

@nkgm I released the EqualSizeSplit action but it doesn't seem to work in the latest IJ 🤷‍♂️ (Probably there was some change in how IDE APIs work.) It also makes more sense to me to have the equal size behaviour built-in (I didn't think it through though) like you described above rather than use a separate action.

Not sure if I'll look into it sometime soon. Any contributions are welcome.