keychord_press_on_file_dialog = function(chord, key) if chord == 'escape' then reset_file_dialog_state() elseif chord == 'return' then File_dialog_callback(File_dialog_input_text) reset_file_dialog_state() elseif chord == 'backspace' then local len = utf8.len(File_dialog_input_text) local byte_offset = Text.offset(File_dialog_input_text, len) File_dialog_input_text = string.sub(File_dialog_input_text, 1, byte_offset-1) refresh_file_dialog_input_start() end end