The font can be manually set in the Preferences, but setting it with Python is very difficult because finding the right path for the Fonts folder cross platform is not easy.
I’ve spend some more hours on updating the essential Auto Complete add-on which also comes with multi-file add-on templates, handling and execution from the Text Editor. I think all of the word and syntax changes has been fixed, but I’m no good with multi-file add-ons. I know registering has changed in 2.80 and therefore I’ve collected all registering of classes in the init, but I need someone to help me out with doing that part right. Anyone? https://github.com/tin2tin/code_autocomplete
Hotstrings:
Here there is a little script that allows the use of hotstrings (text replacement as we type) inside the Blender’s text editor. Updated to support all python 3 builtins. list, repr, abs, dict, … will add parenthesis automatically.
I don’t know if you guys noticed, but in an attempt to raise awareness about the fine Text Editor add-ons here in this thread, I set up at poll. But since the number of votes doesn’t reflect the sparse number of clicks to download the add-ons here, I guess the votes only reflect an interest in seeing an add-on with that name in the Text Editor.
Hi I tried some things and that’s really useful. I wanted to do an addon but it already existed. for incremental autosave. really useful when coding and having some crashes…I explain how to configure things there and the addon is in the description or on github in sambler chanel https://www.youtube.com/watch?v=0Oyalp8dXl8
I have a self made pie menu I use for the Text Editor (Shift + RMB), very similar to Pistiwique’s.
Can somebody help me implement my “DeleteLine” class?
For the moment, it deletes the line I’m on and makes a backspace. But it works only on one line.
I’m struggling to make it delete all the selected lines at once.
class DeleteLine(bpy.types.Operator):
bl_idname = "text.delete_line"
bl_label = "Delete Line"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(self, context):
return context.edit_text is not None
def execute(self, context):
bpy.ops.text.select_line()
bpy.ops.text.delete()
bpy.ops.text.delete(type='PREVIOUS_CHARACTER')
return {'FINISHED'}
A basic ‘get selected text’ function is missing from the API and blocking for development of built-in operators for the Text Editor in Python. Iceythe/Kaio has submitted at patch to deal with this, so show some love here, if you would find that useful: https://developer.blender.org/D6377
Hi. Sometime I find a script and then I paste it in the text editor and I’m searching for info in the API. so I was thinking about a way to go to the API directly from right clic when selecting.
In the first post of this thread you’ll find a lot of add-ons for the Text Editor including one for searching the API etc. through the right click menu.