Skip to content

Commit

Permalink
https://github.com/joshnajera/godot-vim/pull/25
Browse files Browse the repository at this point in the history
  • Loading branch information
hyouuu authored Apr 4, 2024
1 parent d366156 commit b1122d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/godot-vim/godot-vim.gd
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func _input(event) -> void:
var key = event as InputEventKey

# Don't process when not a key action
if key == null or !key.is_pressed() or not the_ed.has_focus():
if key == null or !key.is_pressed() or not the_ed or not the_ed.has_focus():
return

if key.get_keycode_with_modifiers() == KEY_NONE and key.unicode == CODE_MACRO_PLAY_END:
Expand Down Expand Up @@ -1405,7 +1405,7 @@ class EditorAdaptor:
return Position.new(result.y, result.x)

func has_focus() -> bool:
return code_editor.has_focus()
return weakref(code_editor).get_ref() and code_editor.has_focus()


class CommandDispatcher:
Expand Down

0 comments on commit b1122d0

Please sign in to comment.