From d73a3d41963e4be560b25e616be57e262eb5ed96 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 26 Mar 2024 16:47:15 -0700 Subject: [PATCH] plug txt-layer-provided tokens into text view rule - both source code & text view rule are now completely powered via the txt visualization layer, rather than the special-purpose txti layer, which is now being retired --- src/df/gfx/df_view_rule_hooks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/df/gfx/df_view_rule_hooks.c b/src/df/gfx/df_view_rule_hooks.c index b64901c4..1e443aa9 100644 --- a/src/df/gfx/df_view_rule_hooks.c +++ b/src/df/gfx/df_view_rule_hooks.c @@ -693,6 +693,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text) U128 text_hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, text_key, top.lang, &text_hash); String8 data = hs_data_from_hash(hs_scope, text_hash); + TXT_LineTokensSlice line_tokens_slice = txt_line_tokens_slice_from_info_data_line_range(scratch.arena, &info, data, r1s64(1, info.lines_count)); //- rjf: info -> code slice info DF_CodeSliceParams code_slice_params = {0}; @@ -711,6 +712,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text) { code_slice_params.line_text[line_idx] = str8_substr(data, info.lines_ranges[line_idx]); code_slice_params.line_ranges[line_idx] = info.lines_ranges[line_idx]; + code_slice_params.line_tokens[line_idx] = line_tokens_slice.line_tokens[line_idx]; } code_slice_params.font = df_font_from_slot(DF_FontSlot_Code); code_slice_params.font_size = ui_top_font_size();