Commit Graph

5 Commits

Author SHA1 Message Date
6859bb6e67 Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
e4afa06dab Fix #107261: bpy.types.Text (region_as_string/region_from_string) crash
These two didnt check if keywords were passed in, crashed on running
`PyDict_GET_SIZE` on NULL (in case of no keywords).

Oversight in ee292a1d66.

Now just check if keywords are actually passed in.

Pull Request: blender/blender#107285
2023-04-24 11:48:22 +02:00
ee292a1d66 PyAPI: use keyword only arguments for Text.region_{from/to} string
This is the convention for most parts of Blender Python API.
2022-04-08 13:28:55 +10:00
e2f4c4db8d Cleanup: pass the buffer length into txt_insert_buf
Also remove redundant NULL check.
2022-04-07 15:45:20 +10:00
Matheus Santos
f49a736ff4 Text Editor: Get/Set region text API
Add the ability to get/set the selected text.

**Calling the new methods:**

- `bpy.data.texts["Text"].region_as_string()`
- `bpy.data.texts["Text"].region_from_string("Replacement")`
2022-04-07 15:17:04 +10:00