Skip to content

Commit

Permalink
minor tweak to monocle to make adding new windows more configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroxoneafour committed Mar 30, 2024
1 parent d80f7fa commit 688d025
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/engine/layouts/monocle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 688d025

Please sign in to comment.