From 688d0257b85bec6d5a2d577a5dc4cdc6787fcf74 Mon Sep 17 00:00:00 2001 From: Vaughan Milliman Date: Sat, 30 Mar 2024 11:59:55 -0500 Subject: [PATCH] minor tweak to monocle to make adding new windows more configurable --- src/engine/layouts/monocle.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/engine/layouts/monocle.ts b/src/engine/layouts/monocle.ts index 7247d64..876b435 100644 --- a/src/engine/layouts/monocle.ts +++ b/src/engine/layouts/monocle.ts @@ -8,6 +8,7 @@ import { EngineSettings, } from "../engine"; import { Direction } from "../../util/geometry"; +import { InsertionPoint } from "../../util/config"; export default class MonocleEngine extends TilingEngine { engineCapability = EngineCapability.None; @@ -26,7 +27,12 @@ export default class MonocleEngine extends TilingEngine { addClient(client: Client) { if (!this.clients.includes(client)) { - this.clients.push(client); + // push to back if insertion point is right, else push new clients to front + if (this.config.insertionPoint == InsertionPoint.Right) { + this.clients.push(client); + } else { + this.clients.splice(0, 0, client); + } } return; }