From 89063990a27aef66f171de4bd001cc993155fe32 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 27 Sep 2019 17:53:58 -0700 Subject: [PATCH] get token array helper --- 4coder_helper.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/4coder_helper.cpp b/4coder_helper.cpp index cbd47c36..18937f14 100644 --- a/4coder_helper.cpp +++ b/4coder_helper.cpp @@ -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); } ////////////////////////////////