BPyTextPlugin now has descriptors for variables, functions and classes (and their variables/functions). Each descriptor also holds the line number of the definition allowing a simple outliner to be written.
Text.setCursorPos(row, col) now pops the text into view if it is in the active window space. The outliner uses this to jump to any definition in a script; it is invoked with Ctrl+T.
This commit is contained in:
@@ -550,6 +550,7 @@ static PyObject *Text_setCursorPos( BPy_Text * self, PyObject * args )
|
||||
{
|
||||
int row, col;
|
||||
int oldstate;
|
||||
SpaceText *st;
|
||||
|
||||
if (!self->text)
|
||||
return EXPP_ReturnPyObjError(PyExc_RuntimeError,
|
||||
@@ -565,6 +566,9 @@ static PyObject *Text_setCursorPos( BPy_Text * self, PyObject * args )
|
||||
txt_move_to(self->text, row, col, 0);
|
||||
txt_set_undostate(oldstate);
|
||||
|
||||
if (curarea->spacetype == SPACE_TEXT && (st=curarea->spacedata.first))
|
||||
pop_space_text(st);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user