backport a bugfix from driver.love

Ignore typing if cursor isn't in viewport.
This commit is contained in:
Kartik K. Agaram 2023-10-22 11:44:37 -07:00
parent 35919374e3
commit 09b8f985db
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
on.text_input = function(t)
if Cursor_node then
if Cursor_node and Cursor_node.editor.cursor_x then
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
edit.text_input(Cursor_node.editor, t)
if not eq(Cursor_node.editor.screen_top1, old_top) then

View File

@ -14,7 +14,7 @@ on.keychord_press = function(chord, key)
-- reset zoom
Viewport.zoom = 1.0
B()
elseif Cursor_node then
elseif Cursor_node and Cursor_node.editor.cursor_x then
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
edit.keychord_press(Cursor_node.editor, chord, key)
if not eq(Cursor_node.editor.screen_top1, old_top) then