Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix formatting problem with RecursiveBinder.showBindHelper() #328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Source/RecursiveBinder.spoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ local function showHelper(keyFuncNameTable)
local lastLine = ''
local count = 0
for keyName, funcName in pairs(keyFuncNameTable) do
count = count + 1
local newEntry = keyName..' → '..funcName
-- make sure each entry is of the same length
if string.len(newEntry) > obj.helperEntryLengthInChar then
Expand All @@ -209,16 +208,16 @@ local function showHelper(keyFuncNameTable)
newEntry = newEntry..string.rep(' ', obj.helperEntryLengthInChar - string.len(newEntry))
end
-- create new line for every helperEntryEachLine entries
if count % (obj.helperEntryEachLine + 1) == 0 then
separator = '\n '
elseif count == 1 then
separator = ' '
if count == 0 then
separator = ''
elseif count % obj.helperEntryEachLine == 0 then
separator = '\n'
else
separator = ' '
end
helper = helper..separator..newEntry
count = count + 1
end
helper = string.match(helper, '[^\n].+$')
previousHelperID = hs.alert.show(helper, obj.helperFormat, true)
end

Expand Down