UI: Console Text Operations #108626

Manually merged
Campbell Barton merged 13 commits from Harley/blender:ConsoleSelect into main 2023-09-22 05:42:35 +02:00
2 changed files with 9 additions and 1 deletions
Showing only changes of commit a89b6d93f2 - Show all commits

View File

@ -218,7 +218,11 @@ static int console_textview_main__internal(SpaceConsole *sc,
console_textview_draw_rect_calc(region, &tvc.draw_rect, &tvc.draw_rect_outer);
/* Nudge right by half a column or so to break selection mid-character. */
const int m_pos[2] = {mval[0] + (tvc.lheight / 4), mval[1]};
int m_pos[2] = {mval[0], mval[1]};
/* Mouse position is initialized with max int. */
if (m_pos[0] != INT_MAX) {
m_pos[0] += tvc.lheight / 4;
}
console_scrollback_prompt_begin(sc, &cl_dummy);
ret = textview_draw(&tvc, do_draw, m_pos, r_mval_pick_item, r_mval_pick_offset);

View File

@ -107,6 +107,10 @@ static int console_delete_editable_selection(SpaceConsole *sc)
return 0;
}
if (sc->sel_start < 0) {
sc->sel_start = 0;
}
ConsoleLine *cl = static_cast<ConsoleLine *>(sc->history.last);
if (!cl || sc->sel_start > cl->len) {
sc->sel_start = sc->sel_end;