centered-window-mode icon indicating copy to clipboard operation
centered-window-mode copied to clipboard

Splitting windows vertically doesn't work

Open sondr3 opened this issue 10 years ago • 15 comments

Hello, this does everything I want for my purposes, however, it refuses to split up windows. I use Evil so I do C-w v to split my window vertically but get the following error message: split-window: Window #<window 3 on emacs.org> too small for splitting (2) [2 times]. However splitting horizontally works just fine. Any ideas why?

I'm using the Emacs 25.1 on OS X El Capitan.

sondr3 avatar Mar 10 '16 04:03 sondr3

I'll take a look asap.

anler avatar Mar 10 '16 09:03 anler

I'm facing the same problem, however, it appears that the issue does not affect M-x split-windows-horizontally

My current workaround until this is fixed is to put (evil-ex-define-cmd "vsp[lit]" 'split-window-horizontally) inside the evil config

An issue with this solution is that now the split windows are both centered. Toggling centered-window-mode does not fix this, but oddly does if the toggling is done in a frame where there are no splits.

wagk avatar Mar 21 '17 07:03 wagk

Hi, I pushed a new version that hopefully will fix this issue.

anler avatar Apr 02 '17 09:04 anler

Issue doesn't seem to be fixed with latest build.

Backtrace

When calling split-window-right:

Debugger entered--Lisp error: (error "Window #<window 369 on centered-window-mode.el> too small for splitting")
  signal(error ("Window #<window 369 on centered-window-mode.el> too small for splitting"))
  error("Window %s too small for splitting" #<window 369 on centered-window-mode.el>)
  split-window(nil nil t)
  split-window-right(nil)
  funcall-interactively(split-window-right nil)
  call-interactively(split-window-right nil nil)
  command-execute(split-window-right)

Environment

  • Emacs: 25.1.50.1
  • OS: Darwin C02RW05YFVH6 15.6.0

xiongtx avatar Apr 27 '17 01:04 xiongtx

I'm working on it, thanks for reporting it!

anler avatar Apr 27 '17 06:04 anler

@Wagk Are you sure you've having problems splitting windows vertically and not horizontally?

split-window-horizontally:

+---------------+     +-------+-------+
|               |     |       |       |
|               | --> |       |       |
|               |     |       |       |
+---------------+     +-------+-------+

split-window-vertically:

+---------------+     +---------------+
|               |     |               |
|               | --> +---------------+
|               |     |               |
+---------------+     +---------------+

Fringes are on the left and right, so the trouble should be with splitting horizontally, not vertically. That's what I'm experiencing.

xiongtx avatar May 11 '17 04:05 xiongtx

@xiongtx Yes I believe split-window-horizontal was the one causing the issue. Apologies

wagk avatar May 11 '17 16:05 wagk

@anler It may be worth taking a look at writeroom-mode /visual-fill-column, which also center the window but don't have this splitting problem, for ideas on how to deal with this issue.

I haven't dug too deeply into how they do things, but one thing I see is that they use margins instead of fringes to center the window.

xiongtx avatar May 11 '17 17:05 xiongtx

Hi all, I haven't forgotten about this, but I'm going to merge #21 first, I'm using it and haven't had this issue since, but still is not a definitive solution. Thanks!

anler avatar May 23 '17 06:05 anler

I just tried out #21, I had to set cwm-frame-internal-border to 0 to avoid having the mode line and the minibuffer being rendered off screen. My window were also only able to be split horizontally once. C-x 3 C-x 1 C-x 3 will still get me the window too small warning.

wyuenho avatar May 27 '17 15:05 wyuenho

@anler I think this is due to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24193,

Olivetti had the same problem and they hacked around it. Maybe you can do something similar? I love this mode since this is the only lightroom mode clone that works with linum.

wyuenho avatar Nov 26 '17 22:11 wyuenho

I'll take a look later today, thanks!

anler avatar Nov 27 '17 09:11 anler

So, using https://github.com/railwaycat/homebrew-emacsmacport, setting fullscreen frame parameter to maximized with (set-frame-parameter nil 'fullscreen 'maximized), C-x 3 RET C-x 1 RET C-x 3 doesn't work. But if I maximize the frame with (toggle-max-frame 'both), splitting windows now works. This is just weird.

wyuenho avatar Nov 28 '17 23:11 wyuenho