Made it so when a text block is removed (using the cross button in the header), the previous text block becomes active, to be consistant with scene and screen delete operations. Also makes removing all the text's within a blend a lot less tedious - (Something I do for bug report Blend's)
change to drawtext was just to comment on what pop_space_text does, names not obvious.
This commit is contained in:
@@ -999,6 +999,8 @@ void drawtextspace(ScrArea *sa, void *spacedata)
|
||||
curarea->win_swap= WIN_BACK_OK;
|
||||
}
|
||||
|
||||
/* Moves the view to the cursor location,
|
||||
also used to make sure the view isnt outside the file */
|
||||
void pop_space_text (SpaceText *st)
|
||||
{
|
||||
int i, x;
|
||||
|
||||
@@ -132,18 +132,29 @@ void do_text_buttons(unsigned short event)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case B_TEXTDELETE:
|
||||
|
||||
text= st->text;
|
||||
if (!text) return;
|
||||
|
||||
/* make the previous text active, if its not there make the next text active */
|
||||
if (st->text->id.prev) {
|
||||
st->text = st->text->id.prev;
|
||||
pop_space_text(st);
|
||||
} else if (st->text->id.next) {
|
||||
st->text = st->text->id.next;
|
||||
pop_space_text(st);
|
||||
}
|
||||
|
||||
BPY_clear_bad_scriptlinks(text);
|
||||
free_text_controllers(text);
|
||||
|
||||
unlink_text(text);
|
||||
free_libblock(&G.main->text, text);
|
||||
|
||||
allqueue(REDRAWTEXT, 0);
|
||||
allqueue(REDRAWHEADERS, 0);
|
||||
break;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user