I have already made the modification for my personal use and It seems to be relevant in the subtance. The form…
So I decided to share it to find out if it is relevant for others and in the first place for the author.
ok I didn’t pay attention at that
the form… yes it is.
I didn’t want to be too abrupt to start the discussion, so I showed my first modification on this subject, which is less radical and gives the choice.
But, for me, options to switch between manual and auto (jump and update) are all superfluous.The manual mode is superfluous. So the addon i use daily is like this:
All is automatic (jump and update) that’s all!
Like i said in my first post perhaps i’m wrong and the manual mode is relevant…
@iceythe Is this much needed patch at a dead end https://developer.blender.org/D6377 ? And what about the horizontal scrollbar for the Text Editor, and progress with that one?
Campbell has a different view of how getting text selection should be implemented (essentially make it into functions that can retrieve or overwrite selection). That was not the idea of the initial implementation (text.write() already does this), so this one will likely be abandoned.
As for the horizontal scrollbar. It was more or less finished last year. But then there were two major commits to the text editor that unified (and broke) offsets, moving runtime variables, so a simple merge isn’t going to happen. Gonna step back a little from spontaneous code contribution and pitch my ideas first so I don’t keep wasting time
I’ve worked on consolidating some of the addons which include most of what I’ve posted here, and added a couple of new operators. I’ll see if I can’t release this in a suite pretty soon.
Goto line with smooth scrolling
Find next / previous occurrence
Cursor history (mouse forward / backward)
Word-snapping selection (double-click drag)
Some cursor position and selection stats aka. make footer great again
The best way is properly to pm Campbell on Blender Chat.
Thank you for all the great stuff you’re doing for the Text Editor. Looking forward to try all the new stuff.
Maybe it’s only me, but the Find and Replace is the element which annoys me the most about the text editor. Maybe we could come up with a more industry standard suggestion for how it should be in the UI and it’s functions?
I tend to think that it would be pretty convenient for users to find your addons in the “Text Editor” category, instead of “Development”.
This way, by just selecting the “Text Editor” category, it becomes possible to filter addons that belong to this category.
Sometimes very useful… Icon Button to open the API
col.operator('wm.url_open', text = '', icon='BLENDER').url="https://docs.blender.org/api/blender_python_api_current/bpy.props.html?highlight=boolproperty#bpy.props.BoolProperty"
-the link for “text insert” is wrong.
good link [https://github.com/K-410/blender-scripts/blob/master/2.8/text_insert2.py]
(it seems not to work)
it seems that the same guy did a save incremental too [https://github.com/K-410/blender-scripts/blob/master/2.8/wm_save_incremental.py]
-“extend to bracket”. could it be possible to add extend to multispace(or tab) and bracket only one side.
e.g: bpy.ops.mesh.normals_make_consistent(inside=False) to select from bpy to first bracket
-since the UI has been modified on the left (numbers) “highlight occurrences” is not well aligned
-debug dev tools the first button debug print variable I had exactly this idea. very useful
-change case (was so obviously missing) but I would prefer it in right clic menu so I will show how to add a quick favorite to text editor in a small video with e.g a shortcut to this function. https://youtu.be/tZsIq9LjEF0
Thank you for feedback and tutorial. Some of the points are for @iceythe.
If we at some point can get operators in Python accepted in the text editor, maybe we could move some of the essential functions into Blender(if they’re accepted). This patch was the canary in the coalmine: https://developer.blender.org/D5097 but maybe the same thing could be tried with operators which do not need an optimized “get selection” operator, like some of those you mention?
I forgot to post some of my Text Editor themes, so here they are:
Sorry for the late reply. Some of the stuff in the current repo is turning absolete and no longer worked on separately. I’ll be going through the repo and removing them soon. They will be replaced by a bigger addon suite which eliminates the need to track several addons.
That’s an interesting idea, but it doesn’t align with the purpose of the operator. I can add a new operator that selects by whole words. I’ve been wanting to add something like this for fast selection, but now that I’ve got double-click word-snapping selection working it’s not been a priority.
Another addition:
This requires minimum 2.82 since it accesses runtime to get the recently added offsets. Also added middle-click for continuous scrolling. Grab scrolling just wasn’t my thing for long texts.
An implementation of folding would mean logical partitioning of scopes and control flow, which would require a robust lexical analyzer (that works for python and osl) to break code into an AST. Then, it’s possible to draw a flattened text based on the visibility of the nodes. Maybe there are some parser libs out there. But in the end I think this would just add a headache to Campbell
If we had something like a foreach method for byte strings, all text drawing could’ve been done in python without any significant penalties.
There are ways to mitigate the need for code folding:
Ctrl click to jump to definition
Robust sidebar code navigation with collapsible entries
Indeed it seems complicated… ^^
I’m already using Code Navigation in the sidebar, but it would have been handy to reduce the code with folds… Thanks anyway!