Skip to content

Commit

Permalink
Correct implementation of clamp
Browse files Browse the repository at this point in the history
That's what I get for inlining definitions.
  • Loading branch information
SquidDev committed Nov 23, 2019
1 parent 3c8c0d7 commit 08cf55e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/resources/assets/computercraft/lua/bios.lua
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ function read( _sReplaceChar, _tHistory, _fnComplete, _sDefault )
local _, cy = term.getCursorPos()
if param2 >= sx and param2 <= w and param2 == cy then
-- Then ensure we don't scroll beyond the current line
nPos = math.min(math.max(nScroll + x - sx, 0, #sLine))
nPos = math.min(math.max(nScroll + x - sx, 0), #sLine)
redraw()
end

Expand Down

1 comment on commit 08cf55e

@JasonTheKitten
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thank you for fixing this

Please sign in to comment.