Page MenuHome

Text Editor Menus - Refreshed & Proposals
AbandonedPublic

Authored by Peter Fog (tintwotin) on Aug 7 2019, 10:03 PM.

Details

Summary

Changes:
Added undo/redo to the context menu.
Inserted comment in context menu, since it was missing.
Renamed Toggle Comments to Toggle Comment, since plural is not used in menus.
Reinserted buttons in Header for line-numbers, word wrap and highlight, since these settings are not on as defaults, when not in Scripting workspace.
Moved Live Edit, to View menu, since it is view related, and didn't fit well in the Edit category, which is for editing operations.
'Top/Bottom of File' renamed to Top/Bottom and placed in Navigation sub-menu.
Added all navigation functions to Navigation menu, since they were not exposed in the menus.
Added all selection functions to Select menu, since they were not exposed in the menus.
Moved the Select menu to the Header in consistency with the 3D View.

Before:

After:

Before:

After:

Before:

After:


Before:

After:

After:

Proposals:
(Which I can't code(I'm Python only))

  • In the Header, next to the text drop down menu, is a copy icon. This should be changed to FILE_NEW since, pressing the button will add a new text-block.
  • Ctrl+F for Find should auto-add selected text to the Find search box(like Find Set Selected).
  • Ctrl+H for Replace should open the sidebar, and add current selection to the replace box, before doing replace, so it is possible so read what will be replaced with what, before doing it.
  • Add search direction: Up & down.
  • Add replace all(in current document). (The current All button is for continuing search over all text blocks)
  • Text Auto Complete: Always use the Python API lib, even though the current text block do not have .py extension(yet). Could be added to Properties to unselect Python API for auto complete.
  • 'Find Set Selected' should have a shortcut key - this function is much more valuable with a hot key function.
  • Register, Live Edit and Make Internal are missing proper documentation, since it is very hard to understand what these functions are for.
  • Add: Remove Trailing Whitespace, since it's annoying to use an external editor for this simple thing.
  • Organize templates in sub-menus when there are several entries in the same categories ex: Gizmo, Operator and UI.
  • Comment operator is missing a tooltip.

Diff Detail

Event Timeline

Nice fixes and changes. I would probably swap the viewport toggles with the Run Script operator button. Other than that it looks good to me.

Yes, reason being to strengthen the connection between the text block and the Run Script operator, and the viewport controls we typically put in the top right.

Alternatively we could even completely remove the Run Script button, since it's in the menu and available in the context menu and via keyboard shortcuts also.

It\s possible to move Run Script a little closer, and maybe a little space around the view buttons is an improvement.

Swapped the viewport toggles with the Run Script operator button:

Peter Fog (tintwotin) edited the summary of this revision. (Show Details)Aug 8 2019, 6:45 AM
Campbell Barton (campbellbarton) requested changes to this revision.EditedAug 8 2019, 6:58 AM

The patch is a little out of date (comment/uncomment have been removed).

Generally like the direction the patch is going, details inline.

release/scripts/startup/bl_ui/space_text.py
272

Py-constraints are not available in the interface.

Also name "Refresh" isn't meaningful.

335

Wrapping args seems unnecessary here.

426–429

Renaming Move Line(s) Up to Move Up looses useful information since this works both with/without selection, makes it seem as if might move the cursor up.

This revision now requires changes to proceed.Aug 8 2019, 6:58 AM

Added select Word to Select menu.

Peter Fog (tintwotin) marked 3 inline comments as done.Aug 8 2019, 7:21 AM
Peter Fog (tintwotin) edited the summary of this revision. (Show Details)
Peter Fog (tintwotin) updated this revision to Diff 16936.

Remove Refresh.
Remove wrapping of args.
Rename to Move Line(s) Up/Down.

Committed rB512b562b3b96d365dce35d91d2a64a78c4483dca but left some changes out.

  • Undo/Redo in context menu

    It's not clear which context menus should have this - at the moment the convention elsewhere is not to. This is almost always used from shortcuts, if not - it's available in the edit menu, so I don't think it's necessary here.
  • Live edit

    This executes text as you type, so I've moved this next to register and run scripts in the text menu.

    It also has security implications (we should show this in the header too, when it's enabled) so I wouldn't group this with other view options.
  • Left the header as is (would rather separate header reorganization from changing menus).
  • Moved "Edit" menu before select. Since Edit is typically one of the first menus (after file for example).
release/scripts/startup/bl_ui/space_text.py
60

Would rather not remove this from the header, it's has significant side effects and it's something you could easily miss.

445

Operators name "Toggle Comments" seems fine, since it operates on multiple comments.

@Campbell Barton (campbellbarton) Thank you for committing this.

NB. I reinserted the view toggle buttons in the header, because removing them seemed to cause a lot of dislikes: D5028

Any thoughts on the proposal elements above?

NB. I reinserted the view toggle buttons in the header, because removing them seemed to cause a lot of dislikes: D5028

Can we just separate that change from the other changes? IMO we should put "rolling back an earlier decision" and "adding more improvements" in different commits.
That way we hopefully get those buttons back sooner (or another decisions on that topic, which would get a clearer discussion when held in its own patch).

Alternatively we could even completely remove the Run Script button, since it's in the menu and available in the context menu and via keyboard shortcuts also.

Please don't do this. Menu access is not as easy as just having a button there. For many people the primary workflow for their scripting work is to edit the script in Blender and run it from the text editor.

As Campbell wrote, when he cherry picked what to commit: "would rather separate header reorganization from changing menus", so no header changes, except menus have been committed, so I guess this diff can be closed?

As Campbell wrote, when he cherry picked what to commit: "would rather separate header reorganization from changing menus", so no header changes, except menus have been committed, so I guess this diff can be closed?

The problem introduced in D5028 (making it much harder to switch to a developer-friendly view) is still there. All I want is to have that problem solved.

Closing diff since this was committed, further changes can be submitted as separate code review if needed.