aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinwit <inwit@sindominio.net>2023-09-28 21:23:19 +0200
committerRobin Jarry <robin@jarry.cc>2023-10-13 00:32:22 +0200
commit0d5443b36e4cf3f74b8334b4734ded7176c026be (patch)
treed3e33312c45a785f80b950cfebcbdc3f03a73df5
parent14baf17f4bd47377403c5d965c1fe294d2ec6ef0 (diff)
downloadaerc-0d5443b36e4cf3f74b8334b4734ded7176c026be.tar.gz
aerc-0d5443b36e4cf3f74b8334b4734ded7176c026be.zip
split: add an alias for horizontal split
To date, there are two orthogonal commands named :vsplit and :split, which create a vertical and a horizontal split, respectively. Add a :hsplit alias for the latter. Signed-Off-By: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
-rw-r--r--app/account.go2
-rw-r--r--commands/account/split.go8
-rw-r--r--doc/aerc.1.scd11
3 files changed, 11 insertions, 10 deletions
diff --git a/app/account.go b/app/account.go
index c7abde6f..312ba89b 100644
--- a/app/account.go
+++ b/app/account.go
@@ -547,7 +547,7 @@ func (acct *AccountView) updateSplitView(msg *models.MessageInfo) {
}
acct.split = NewMessageViewer(acct, view)
switch acct.splitDir {
- case "split":
+ case "split", "hsplit":
acct.grid.AddChild(acct.split).At(1, 1)
case "vsplit":
acct.grid.AddChild(acct.split).At(0, 2)
diff --git a/commands/account/split.go b/commands/account/split.go
index ddc79e2f..4a17b8b2 100644
--- a/commands/account/split.go
+++ b/commands/account/split.go
@@ -15,7 +15,7 @@ func init() {
}
func (Split) Aliases() []string {
- return []string{"split", "vsplit"}
+ return []string{"split", "vsplit", "hsplit"}
}
func (Split) Complete(args []string) []string {
@@ -24,7 +24,7 @@ func (Split) Complete(args []string) []string {
func (Split) Execute(args []string) error {
if len(args) > 2 {
- return errors.New("Usage: [v]split n")
+ return errors.New("Usage: [v|h]split n")
}
acct := app.SelectedAccount()
if acct == nil {
@@ -51,7 +51,7 @@ func (Split) Execute(args []string) error {
}
n, err = strconv.Atoi(args[1])
if err != nil {
- return errors.New("Usage: [v]split n")
+ return errors.New("Usage: [v|h]split n")
}
if delta {
n = acct.SplitSize() + n
@@ -69,7 +69,7 @@ func (Split) Execute(args []string) error {
n = 1
}
switch args[0] {
- case "split":
+ case "split", "hsplit":
return acct.Split(n)
case "vsplit":
return acct.Vsplit(n)
diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd
index 4456e0e9..d981e014 100644
--- a/doc/aerc.1.scd
+++ b/doc/aerc.1.scd
@@ -462,15 +462,16 @@ message list, the message in the message viewer, etc).
Selects the _<n>_\th message in the message list (and scrolls it into
view if necessary).
+*:hsplit* [[_+_|_-_]_<n>_]
*:split* [[_+_|_-_]_<n>_]
Creates a horizontal split, showing _<n>_ messages and a message view
below the message list. If a _+_ or _-_ is prepended, the message list
size will grow or shrink accordingly. The split can be cleared by
- calling *:split* _0_, or just *:split*. The split can be toggled by
- calling split with the same (absolute) size repeatedly. For example,
- *:split* _10_ will create a split. Calling *:split* _10_ again will
- remove the split. If not specified, _<n>_ is set to an estimation based
- on the user's terminal. Also see *:vsplit*.
+ calling *:[h]split* _0_, or just *:[h]split*. The split can be toggled
+ by calling split with the same (absolute) size repeatedly. For example,
+ *:[h]split* _10_ will create a split. Calling *:[h]split* _10_ again
+ will remove the split. If not specified, _<n>_ is set to an estimation
+ based on the user's terminal. Also see *:vsplit*.
*:sort* [[*-r*] _<criterion>_]...
Sorts the message list by the given criteria. *-r* sorts the