get token array helper

This commit is contained in:
Allen Webster 2019-09-27 17:53:58 -07:00
parent 783d4cc147
commit 89063990a2
1 changed files with 7 additions and 3 deletions

View File

@ -1876,9 +1876,13 @@ try_buffer_kill(Application_Links *app, Buffer_ID buffer, View_ID gui_view_id, B
internal Token_Array
get_token_array_from_buffer(Application_Links *app, Buffer_ID buffer){
Token_Array array = {};
// TODO(allen): implement
return(array);
Token_Array result = {};
Managed_Scope scope = buffer_get_managed_scope(app, buffer);
Token_Array *ptr = scope_attachment(app, scope, attachment_tokens, Token_Array);
if (ptr != 0){
result = *ptr;
}
return(result);
}
////////////////////////////////