Skip to content

Commit 239bcc8

Browse files
authored
fix formatting problem with RecursiveBinder.showBindHelper() (#328)
1 parent 95958fc commit 239bcc8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Source/RecursiveBinder.spoon/init.lua

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ local function showHelper(keyFuncNameTable)
200200
local lastLine = ''
201201
local count = 0
202202
for keyName, funcName in pairs(keyFuncNameTable) do
203-
count = count + 1
204203
local newEntry = keyName..''..funcName
205204
-- make sure each entry is of the same length
206205
if string.len(newEntry) > obj.helperEntryLengthInChar then
@@ -209,16 +208,16 @@ local function showHelper(keyFuncNameTable)
209208
newEntry = newEntry..string.rep(' ', obj.helperEntryLengthInChar - string.len(newEntry))
210209
end
211210
-- create new line for every helperEntryEachLine entries
212-
if count % (obj.helperEntryEachLine + 1) == 0 then
213-
separator = '\n '
214-
elseif count == 1 then
215-
separator = ' '
211+
if count == 0 then
212+
separator = ''
213+
elseif count % obj.helperEntryEachLine == 0 then
214+
separator = '\n'
216215
else
217216
separator = ' '
218217
end
219218
helper = helper..separator..newEntry
219+
count = count + 1
220220
end
221-
helper = string.match(helper, '[^\n].+$')
222221
previousHelperID = hs.alert.show(helper, obj.helperFormat, true)
223222
end
224223

0 commit comments

Comments
 (0)