emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prefer to split along the longest edge


From: Liu Hui
Subject: Re: Prefer to split along the longest edge
Date: Tue, 17 Dec 2024 09:51:40 +0800
User-agent: Mozilla Thunderbird



在 2024/12/16 19:56, Nicolas Desprès 写道:

I wrote a new patch that always fallback on vertical split, and I got rid of the weird (width > 80) condition since split-width-threshold already does it.

The result is a simpler patch that works perfectly.

It basically does that:

if width > height:
    try to split horizontally, then try to split vertically
else
    try to split vertically, then try to split horizontally
fallback to vertical split

Hi,

I have the same problem when using emacs. Thank you for the patch.

I think the main reason is that vertical split is always preferred
when vertical and horizontal split are both feasible (i.e. width >
split-width-threshold and height > split-height-threshold).

So it seems unnecessary to compare the width and height. How about
adding an option, e.g. split-window-preferred-direction, and change
the condition as follows?

if user prefers horizontal split
    try to split horizontally, then try to split vertically
else
    try to split vertically, then try to split horizontally


Hui



reply via email to

[Prev in Thread] Current Thread [Next in Thread]