zedapp / zed

Rethinking code editing.
http://zedapp.org
MIT License
2.22k stars 161 forks source link

Add a horizontal split to editor "frames" #573

Open jcmdln opened 8 years ago

jcmdln commented 8 years ago

Something that would be beneficial in my opinion would be to switch from a vertical split to a horizontal split (side-by-side frames versus stacked frames) by pressing Ctrl+Shift+{2,3}. The current behavior of Ctrl+Shift+2, for instance, will split the current frame but not re-size it with multiple presses as Ctrl+2 does. It appears that this may be added without too much complication or using some weird keybind variant that wouldn't be similar to the current methods of adjusting windows.

For clarity of what behavior I'm intending:

(I might not have articulated that well, though I'm willing to provide clarification if needed)

For users with small screens who have a terminal window open it would save that oh-so-precious screen real estate in cases (such as Windows 8 or earlier) where virtual desktops are not a standard feature. I believe I read over most of the philosophy of Zed and I don't see this as intrusive to it's goals, but I'd like to know more about if this sort of change would be welcome.

keltieem commented 8 years ago

I'm interested in looking into this more but I am fairly new to the project. Any idea of where I could start?

Edit: I'm reading the code and it seems as though the current commands already provide 3 different ways of splitting the screen in two pieces (equally or in 1/3 to 2/3 ratios). Do you think it would be easier to implement a horizontal key which would change the display to a horizontal split, or simply create more modes?

zefhemel commented 8 years ago

While I can see how this is an interesting feature I should warn that it may not be super trivial to implement. For simplicity (both from a code and UX perspective) I decided to implement only vertical splits and do so in the most simple way possible. Effectively there is CSS and DOM elements hardcoded to just support up to 3 splits and only a very constrained configuration: https://github.com/zedapp/zed/blob/master/app/js/split.js

Personally I wouldn't use this feature (I actually like that my options are limited), but of course, you can go ahead an refactor how splits work today.