InputText: up/down arrows move cursor to start/end of line (#7976)

when already on the first or last line.
This commit is contained in:
hius07
2021-07-15 11:27:21 +03:00
committed by GitHub
parent 4b7ac191dc
commit 5947085ba4

View File

@@ -1711,13 +1711,11 @@ function TextBoxWidget:moveCursorRight()
end
function TextBoxWidget:moveCursorUp()
if self.vertical_string_list and #self.vertical_string_list < 2 then return end
local x, y = self:_getXYForCharPos()
self:moveCursorToXY(x, y - self.line_height_px)
end
function TextBoxWidget:moveCursorDown()
if self.vertical_string_list and #self.vertical_string_list < 2 then return end
local x, y = self:_getXYForCharPos()
self:moveCursorToXY(x, y + self.line_height_px)
end