From ed8731c09321bf86a6175ed517336418c36d6533 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Fri, 31 May 2024 10:47:46 -0700 Subject: [PATCH] correctly handle copy path in new multicursor-able watch view controls --- src/df/gfx/df_views.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 93a85a2e..2da7554b 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -1142,6 +1142,12 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS String8 string = str8(edit_state->input_buffer, edit_state->input_size); UI_TxtOp op = ui_single_line_txt_op_from_event(scratch.arena, evt, string, edit_state->cursor, edit_state->mark); + // rjf: copy + if(op.flags & UI_TxtOpFlag_Copy && selection_tbl.min.x == selection_tbl.max.x && selection_tbl.min.y == selection_tbl.max.y) + { + os_set_clipboard_text(op.copy); + } + // rjf: any valid op & autocomplete hint? -> perform autocomplete first, then re-compute op if(autocomplete_hint_string.size != 0) {