driver.love/0022-on.text_input

20 lines
831 B
Plaintext

on.text_input = function(t)
print('text input', t)
if Manifest_navigator.show then
text_input_on_manifest_navigator(t)
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}
local old_definition_name = live.get_definition_name_from_buffer(live.definition_to_string(Cursor_node.editor))
edit.text_input(Cursor_node.editor, t)
pan_viewport_to_contain_cursor(Cursor_node)
local definition_name = live.get_definition_name_from_buffer(live.definition_to_string(Cursor_node.editor))
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
Cursor_node.bg = definition_background_color(definition_name)
if eq(Cursor_node.editor.screen_top1, old_top) then
B()
else
A()
end
end
end