Skip to content

Commit

Permalink
Say blank for blank lines
Browse files Browse the repository at this point in the history
  • Loading branch information
tspivey committed Jul 13, 2022
1 parent 38f8c05 commit fd31905
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/keys/reader/curline.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
local line = getLines(reader.line, reader.line + 1)[1]
reader.say(line, true)
reader.stop()
reader.sayline(line)
3 changes: 2 additions & 1 deletion src/keys/reader/lastline.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- We subtract 1 here because of the always blank line at the end.
reader.line = getLineCount() - 1
local line = getLines(reader.line, reader.line + 1)[1]
reader.say(line, true)
reader.stop()
reader.sayline(line)
2 changes: 1 addition & 1 deletion src/keys/reader/nextline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ if reader.line > getLineCount() - 1 then
reader.line = getLineCount() - 1
end
local line = getLines(reader.line, reader.line + 1)[1]
reader.say(line)
reader.sayline(line)
2 changes: 1 addition & 1 deletion src/keys/reader/prevline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ if reader.line < 0 then
reader.line = 0
end
local line = getLines(reader.line, reader.line + 1)[1]
reader.say(line)
reader.sayline(line)
10 changes: 10 additions & 0 deletions src/scripts/reader/code.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ function reader.remove(event, pkg)
end
registerAnonymousEventHandler("sysUninstall", reader.remove, true)
function reader.stop()
if getOS() == "windows" then
return
end
ttsClearQueue()
ttsSkip()
end
Expand All @@ -42,6 +45,13 @@ function reader.say(text, interrupt)
ttsQueue(text)
end

function reader.sayline(line)
if line == "" then
line = "blank"
end
reader.say(line)
end

if getOS() ~= "windows" then
reader.send_event = registerAnonymousEventHandler("sysDataSendRequest", function()
if command then
Expand Down

0 comments on commit fd31905

Please sign in to comment.