backport a bugfix from driver.love
Ignore typing if cursor isn't in viewport.
This commit is contained in:
parent
35919374e3
commit
09b8f985db
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue