Created
May 8, 2023 06:03
-
-
Save marcusramberg/327693efc91d54ab73ce6462d87c3d82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/nimdowpkg/client.nim b/src/nimdowpkg/client.nim | |
index 8a9a7b0..d62dbac 100644 | |
--- a/src/nimdowpkg/client.nim | |
+++ b/src/nimdowpkg/client.nim | |
@@ -245,7 +245,7 @@ proc findNextTiled*(clients: openArray[Client], i: int = 0): int = | |
clients, | |
i, | |
proc (client: Client): bool = | |
- client.isNormal and not client.isFloating and not client.isFullscreen | |
+ client.isNormal and not client.isFloating and not client.isFullscreen | |
) | |
proc findPreviousNormal*(clients: openArray[Client], i: int = 0): int = | |
@@ -260,7 +260,7 @@ proc findPreviousTiled*(clients: openArray[Client], i: int = 0): int = | |
clients, | |
i, | |
proc (client: Client): bool = | |
- client.isNormal and not client.isFloating and not client.isFullscreen | |
+ client.isNormal and not client.isFloating and not client.isFullscreen | |
) | |
proc hash*(this: Client): Hash = !$Hash(this.window) | |
diff --git a/src/nimdowpkg/config/configloader.nim b/src/nimdowpkg/config/configloader.nim | |
index 6da34cd..5344ccd 100644 | |
--- a/src/nimdowpkg/config/configloader.nim | |
+++ b/src/nimdowpkg/config/configloader.nim | |
@@ -4,7 +4,7 @@ import | |
parsetoml, | |
strutils, | |
tables, | |
- x11 / [x, xlib] | |
+ x11 / [x, xlib] | |
import | |
apprules, | |
@@ -130,7 +130,7 @@ proc getAutostartCommands(this: Config, configTable: TomlTable): seq[string] = | |
return | |
let autoStartTable = configTable["autostart"] | |
if autoStartTable.kind != TomlValueKind.Table: | |
- raise newException(Exception,"Invalid autostart table") | |
+ raise newException(Exception, "Invalid autostart table") | |
if not autoStartTable.tableVal[].hasKey("exec"): | |
raise newException(Exception, "Autostart table does not have exec key") | |
@@ -143,7 +143,7 @@ proc getAutostartCommands(this: Config, configTable: TomlTable): seq[string] = | |
proc runCommand(this: Config, cmd: string) = | |
try: | |
- let process = startProcess(command = cmd, options = { poEvalCommand }) | |
+ let process = startProcess(command = cmd, options = {poEvalCommand}) | |
this.eventManager.submitProcess(process) | |
except: | |
log "Failed to start command: " & cmd, lvlWarn | |
@@ -201,11 +201,11 @@ proc populateDefaultMonitorSettings(this: Config, display: PDisplay) = | |
fonts: @[ | |
"monospace:size=10:antialias=true", | |
"NotoColorEmoji:size=10:antialias=true" | |
- ], | |
- fgColor: 0xfce8c3, | |
- bgColor: 0x1c1b19, | |
- selectionColor: 0x519f50, | |
- urgentColor: 0xef2f27 | |
+ ], | |
+ fgColor: 0xfce8c3, | |
+ bgColor: 0x1c1b19, | |
+ selectionColor: 0x519f50, | |
+ urgentColor: 0xef2f27 | |
) | |
this.defaultMonitorSettings.layoutSettings = LayoutSettings( | |
diff --git a/src/nimdowpkg/config/tagsettings.nim b/src/nimdowpkg/config/tagsettings.nim | |
index e18a89c..64e74b2 100644 | |
--- a/src/nimdowpkg/config/tagsettings.nim | |
+++ b/src/nimdowpkg/config/tagsettings.nim | |
@@ -35,7 +35,7 @@ proc parseTagSetting(tagSetting: var TagSetting, settingsTable: TomlTableRef) = | |
if settingsTable.hasKey("defaultMasterWidthPercentage"): | |
let masterWidthSetting = settingsTable["defaultMasterWidthPercentage"] | |
if masterWidthSetting.kind == TomlValueKind.Int: | |
- tagSetting.defaultMasterWidthPercentage = masterWidthSetting.intVal.int.clamp(10,90) | |
+ tagSetting.defaultMasterWidthPercentage = masterWidthSetting.intVal.int.clamp(10, 90) | |
if tagSetting.defaultMasterWidthPercentage != masterWidthSetting.intVal: | |
log "Invalid defaultMasterWidthPercentage, clamped to 10-90%", lvlWarn | |
else: | |
diff --git a/src/nimdowpkg/event/xeventmanager.nim b/src/nimdowpkg/event/xeventmanager.nim | |
index 4c938fa..b9f7066 100644 | |
--- a/src/nimdowpkg/event/xeventmanager.nim | |
+++ b/src/nimdowpkg/event/xeventmanager.nim | |
@@ -45,7 +45,7 @@ proc removeListener*(this: XEventManager, listener: XEventListener, types: varar | |
when defined(debug): | |
proc logEventTypeName(e: XEvent) = | |
- case e.theType: | |
+ case e.theType: | |
of KeyPress: | |
log "KeyPress" | |
of KeyRelease: | |
diff --git a/src/nimdowpkg/layouts/masterstacklayout.nim b/src/nimdowpkg/layouts/masterstacklayout.nim | |
index 5867e8a..abf13d2 100644 | |
--- a/src/nimdowpkg/layouts/masterstacklayout.nim | |
+++ b/src/nimdowpkg/layouts/masterstacklayout.nim | |
@@ -232,7 +232,7 @@ proc calcYPosition( | |
var pos = int(outerGap) + int(stackIndex * (this.gapSize + clientHeight + this.borderWidth * 2)) | |
if stackIndex == clientsInColumn - 1: | |
- pos += roundingError | |
+ pos += roundingError | |
return max(0, pos).uint | |
diff --git a/src/nimdowpkg/monitor.nim b/src/nimdowpkg/monitor.nim | |
index e93e16c..ed0ab8a 100644 | |
--- a/src/nimdowpkg/monitor.nim | |
+++ b/src/nimdowpkg/monitor.nim | |
@@ -106,7 +106,7 @@ proc updateMonitor*(this: Monitor) = | |
this.taggedClients, | |
this.monitorSettings.tagSettings | |
) | |
- | |
+ | |
for i, tag in this.taggedClients.tags: | |
tag.layout.monitorArea = this.area | |
this.doLayout() | |
diff --git a/src/nimdowpkg/taggedclients.nim b/src/nimdowpkg/taggedclients.nim | |
index 99b2c02..2b3694c 100644 | |
--- a/src/nimdowpkg/taggedclients.nim | |
+++ b/src/nimdowpkg/taggedclients.nim | |
@@ -69,7 +69,7 @@ proc findByWindowInCurrentTags*(this: TaggedClients, window: Window): Client = | |
return client | |
return nil | |
-proc findLastLayoutNode*( this: TaggedClients): ClientNode = | |
+proc findLastLayoutNode*(this: TaggedClients): ClientNode = | |
for n in this.currClientsReverseIter: | |
if not n.value.isFloating: | |
return n | |
@@ -155,8 +155,8 @@ proc currClientNode*(this: TaggedClients): ClientNode = | |
## of clients that are available in the selectedTags. | |
var currClient: Client | |
for client in this.currClientsSelectionNewToOldIter: | |
- currClient = client | |
- break | |
+ currClient = client | |
+ break | |
if currClient == nil: | |
return nil | |
diff --git a/src/nimdowpkg/taginfo.nim b/src/nimdowpkg/taginfo.nim | |
index dd2b908..73b4835 100644 | |
--- a/src/nimdowpkg/taginfo.nim | |
+++ b/src/nimdowpkg/taginfo.nim | |
@@ -7,6 +7,6 @@ type | |
numMasterWindows*: Positive | |
defaultMasterWidthPercentage*: int | |
-proc newTagSetting*(displayString: string, numMasterWindows: Positive, defaultMasterWidthPercentage :int): TagSetting = | |
+proc newTagSetting*(displayString: string, numMasterWindows: Positive, defaultMasterWidthPercentage: int): TagSetting = | |
TagSetting(displayString: displayString, numMasterWindows: numMasterWindows, defaultMasterWidthPercentage: defaultMasterWidthPercentage) | |
diff --git a/tests/nimdowpkg/config/apprules_test.nim b/tests/nimdowpkg/config/apprules_test.nim | |
index 82908f5..46874c1 100644 | |
--- a/tests/nimdowpkg/config/apprules_test.nim | |
+++ b/tests/nimdowpkg/config/apprules_test.nim | |
@@ -24,7 +24,7 @@ describe "App rules": | |
doAssert firstRule.class == "Element" | |
doAssert firstRule.instance == "element" | |
doAssert firstRule.monitorID == 2.Positive | |
- doAssert firstRule.tagIDs == @[ 1.TagID, 9 ] | |
+ doAssert firstRule.tagIDs == @[1.TagID, 9] | |
it "validates multiple app rules": | |
let testToml: string = """ | |
@@ -74,35 +74,35 @@ describe "App rules": | |
doAssert firstRule.class == "Element" | |
doAssert firstRule.instance == "element" | |
doAssert firstRule.monitorID == 2.Positive | |
- doAssert firstRule.tagIDs == @[ 1.TagID, 9 ] | |
+ doAssert firstRule.tagIDs == @[1.TagID, 9] | |
doAssert firstRule.state == wsFullscreen | |
let secondRule = rules[1] | |
doAssert secondRule.class == "st" | |
doAssert secondRule.instance == "st" | |
doAssert secondRule.monitorID == 1.Positive | |
- doAssert secondRule.tagIDs == @[ 3.TagID, 7, 8 ] | |
+ doAssert secondRule.tagIDs == @[3.TagID, 7, 8] | |
doAssert secondRule.state == wsFloating | |
let thirdRule = rules[2] | |
doAssert thirdRule.class == "st" | |
doAssert thirdRule.instance == "st" | |
doAssert thirdRule.monitorID == 1.Positive | |
- doAssert thirdRule.tagIDs == @[ 3.TagID, 7, 8 ] | |
+ doAssert thirdRule.tagIDs == @[3.TagID, 7, 8] | |
doAssert thirdRule.state == wsNormal | |
let fourthRule = rules[3] | |
doAssert fourthRule.class == "st" | |
doAssert fourthRule.instance == "st" | |
doAssert fourthRule.monitorID == 1.Positive | |
- doAssert fourthRule.tagIDs == @[ 3.TagID, 7, 8 ] | |
+ doAssert fourthRule.tagIDs == @[3.TagID, 7, 8] | |
doAssert fourthRule.state == wsNormal | |
let fifthRule = rules[4] | |
doAssert fifthRule.class == "st" | |
doAssert fifthRule.instance == "st" | |
doAssert fifthRule.monitorID == 1.Positive | |
- doAssert fifthRule.tagIDs == @[ 3.TagID, 7, 8 ] | |
+ doAssert fifthRule.tagIDs == @[3.TagID, 7, 8] | |
doAssert fifthRule.state == wsNormal | |
it "does not raise an exception if there are no app rules": |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment