Use only one edit menu for TextEditors #112368
Open
+513
−456
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There does not need to be new Edit, Search, and Go to menus for every single open script and text file.
There only needs to be one for ScriptTextEditor and one for TextEditor, because ScriptTextEditor has some extra options.
The syntax highlighters in (Script)TextEditor now use a LocalVector instead of a Hashmap, since the order matters and it doesn't need to be a Hashmap. The highlighter menu is now created on about_to_popup instead of add/set, since there is only one.
The TextEditor menus are now organized in sub menus, like in ScriptTextEditor.
Most of the code for the menus is now the same, I plan to combine them later.
TextEditor bookmarks go to list now use backticks ` like ScriptTextEditor
TextEditor bookmarks go to list now replaces tabs with spaces for display like ScriptTextEditor (the missing character from #34091 is not rendered anyway due to other changes, but this change was missed back then).
This makes the menus static in their respective classes, but I may move it in a future PR.
This is about ~28% faster, when opening 100 scripts and 100 text files (9177ms to 7169ms avg, on a debug build). I'm using se-slow-200-misc.zip (Open all by dropping them all in the script list).