From 09b8f985db258d0928904028cb8a8eeb6e532c0c Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 22 Oct 2023 11:44:37 -0700 Subject: [PATCH] backport a bugfix from driver.love Ignore typing if cursor isn't in viewport. --- 0022-on.text_input | 2 +- 0023-on.keychord_press | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/0022-on.text_input b/0022-on.text_input index aa9ca81..8645c1c 100644 --- a/0022-on.text_input +++ b/0022-on.text_input @@ -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 diff --git a/0023-on.keychord_press b/0023-on.keychord_press index 0d80349..1d8d944 100644 --- a/0023-on.keychord_press +++ b/0023-on.keychord_press @@ -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