Clear tokens when beginning a relex async task
This commit is contained in:
parent
17bc2de308
commit
3aaa88c2cc
|
@ -793,11 +793,11 @@ BUFFER_EDIT_RANGE_SIG(default_buffer_edit_range){
|
||||||
token_drop_eof(&relex_list);
|
token_drop_eof(&relex_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Base_Allocator *allocator = managed_scope_allocator(app, scope);
|
||||||
|
|
||||||
Token_Relex relex = token_relex(relex_list, relex_range.first - text_shift,
|
Token_Relex relex = token_relex(relex_list, relex_range.first - text_shift,
|
||||||
ptr->tokens, token_index_first, token_index_resync_guess);
|
ptr->tokens, token_index_first, token_index_resync_guess);
|
||||||
|
|
||||||
Base_Allocator *allocator = managed_scope_allocator(app, scope);
|
|
||||||
|
|
||||||
if (relex.successful_resync){
|
if (relex.successful_resync){
|
||||||
i64 token_index_resync = relex.first_resync_index;
|
i64 token_index_resync = relex.first_resync_index;
|
||||||
|
|
||||||
|
@ -829,6 +829,8 @@ BUFFER_EDIT_RANGE_SIG(default_buffer_edit_range){
|
||||||
ptr->max = new_tokens_count;
|
ptr->max = new_tokens_count;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
base_free(allocator, ptr->tokens);
|
||||||
|
block_zero_struct(ptr);
|
||||||
*lex_task_ptr = async_task_no_dep(&global_async_system, do_full_lex_async,
|
*lex_task_ptr = async_task_no_dep(&global_async_system, do_full_lex_async,
|
||||||
make_data_struct(&buffer_id));
|
make_data_struct(&buffer_id));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue