cleanup around single vs. multiline text mutation controls

This commit is contained in:
Ryan Fleury committed 2026-07-27 14:47:32 -07:00
1 parent 315e0672d3
commit c8dae72968
7 files changed
+173 -225

No files matched your search

+3 -3
View File
@@ -2726,10 +2726,10 @@ rd_view_ui(Rng2F32 rect)
RD_WatchPt pt = {row->block->key, row->key, rd_id_from_watch_cell(cell)};
RD_WatchViewTextEditState *edit_state = rd_watch_view_text_edit_state_from_pt(ewv, pt);
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);
UI_TxtOp op = ui_single_line_txt_op_from_event(scratch.arena, evt, string, r1u64(0, string.size), 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)
if(evt->flags & UI_EventFlag_Copy && selection_tbl.min.x == selection_tbl.max.x && selection_tbl.min.y == selection_tbl.max.y)
{
wm_set_clipboard_text(op.copy);
}
@@ -2747,7 +2747,7 @@ rd_view_ui(Rng2F32 rect)
edit_state->input_size = new_string.size;
edit_state->cursor = edit_state->mark = autocomp_cursor_info->replaced_range.min+autocomplete_string.size;
string = str8(edit_state->input_buffer, edit_state->input_size);
op = ui_single_line_txt_op_from_event(scratch.arena, evt, string, edit_state->cursor, edit_state->mark);
op = ui_single_line_txt_op_from_event(scratch.arena, evt, string, r1u64(0, string.size), edit_state->cursor, edit_state->mark);
}
// rjf: cancel? -> revert to initial string