0
$\begingroup$

Currently you can select a line with the select_line command. The problem is that you select the complete line, with the indentations.

I'd like to know how I can select only the words of the current line, to integrate it in a pie please.

$\endgroup$
1
  • 2
    $\begingroup$ It would be better if you had posted the relevant code along with the question. In case you have the selected line in a string call string.lstrip() to get rid of the leading whitespace. $\endgroup$
    – stacker
    Commented Jul 7, 2015 at 15:11

1 Answer 1

2
$\begingroup$
def execute(self, context):

    bpy.ops.text.move(type='LINE_BEGIN')
    bpy.ops.text.move(type='NEXT_WORD')
    bpy.ops.text.move_select(type='LINE_END')
    return {'FINISHED'}

This selects whitespace at the end of the line.

$\endgroup$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .