Page MenuHome

Add set selection function to text api
Needs RevisionPublic

Authored by Gyro Gearloose (pink.vertex) on Nov 9 2015, 11:53 AM.



There is no operator/api function available to set the cursor and selection passing line and column as arguments.

See How to set cursor position in the text editor?

Diff Detail

rB Blender

Event Timeline

Gyro Gearloose (pink.vertex) retitled this revision from to Add set selection function to text api.Nov 9 2015, 11:53 AM
Gyro Gearloose (pink.vertex) updated this object.
Gyro Gearloose (pink.vertex) set the repository for this revision to rB Blender.
Gyro Gearloose (pink.vertex) updated this revision to Diff 5416.
Campbell Barton (campbellbarton) requested changes to this revision.EditedThu, Aug 1, 11:07 AM

In general this is useful, there is a problem though.

The character values are incompatible with Text.current_character which don't account for multi-byte characters.

The RNA properties current_character and select_end_character should be wrapped by get/set functions to make the values index the characters instead of the bytes, then they will be compatible with inputs for this function.

This revision now requires changes to proceed.Thu, Aug 1, 11:07 AM